PC SOFT

WINDEVWEBDEV AND WINDEV MOBILE
ONLINE HELP

Home | Sign in | English UK
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadApple WatchUniversal Windows 10 AppWindows Mobile
Others
Stored procedures
WebserviceReadMIMEType (Function)
In french: WebserviceLitTypeMIME
AjaxNot available
Returns the MIME type of the request received during a call to a REST Webservice.
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 MIMI communication standard (available on Internet). The most common values are:
  • "text/html": HTML page (*.htm, *.html)
  • "text/plain": text file (*.txt)
  • "application/pdf": document in PDF format (*.pdf)
  • "image/gif": image in GIF format (*.gif)
  • "image/jpeg": image in JPEG format (*.jpg, *.jpeg)
  • "video/mpeg": video in MPEG format (*.mpg, *.mpeg)
  • "application/unknown": used to display a dialog box proposing to download the file onto the computer of the Web user.
  • "application/msword": used to display a Word file.
  • "application/vnd.ms-excel": used to display an Excel file.
Remarks
This function is only available during the call to a function that processes a request of a REST Webservice. In the other cases, the function returns an empty string.
Component : wd240awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment