ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / Web services
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
WebserviceReadMIMEType (Function)
In french: WebserviceLitTypeMIME
AjaxNot available
Returns the MIME type of the request received when calling a REST web service.
Example
// Accepts a JSON or XML content
SWITCH WebserviceReadMIMEType()
CASE "application/json"
// Processes the JSON case
...
CASE "application/xml"
// Processes the XML case
...
OTHER CASE
// Processes the other cases (triggers an error)
// Indicates that the format of received data is in unknown:
// 415 Unsupported Media Type
WebserviceWriteHTTPCode(415, sError)
RETURN
END
Syntax
<MIME type> = WebserviceReadMIMEType()
<MIME type>: Character string
MIME type received in the HTTP Content-Type header.
Hundreds of types are defined in the MIME communication standard (available on the Internet). The most common values are:
  • "text/html": HTML page (*.htm, *.html)
  • "text/plain": text file (*.txt)
  • "application/pdf": PDF document (*.pdf)
  • "image/gif": GIF image (*.gif)
  • "image/jpeg": JPEG image (*.jpg, *.jpeg)
  • "video/mpeg": MPEG video (*.mpg, *.mpeg)
  • "application/unknown": displays a dialog box allowing the user to download the file.
  • "application/msword": displays a Word file.
  • "application/vnd.ms-excel": displays an Excel file.
Remarks
This function is only available when calling a function that processes a REST web service request. In all other cases, the function returns an empty string.
Component: wd290awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/16/2024

Send a report | Local help