ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

This content has been translated automatically.  Click here  to view the French version.
Help / WLanguage / WLanguage functions / Communication / Web service functions
WINDEV
WindowsLinuxJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac Catalyst
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
// Accepte un contenu JSON ou XML
SWITCH WebserviceReadMIMEType()
	CASE "application/json"
		// Traite le cas JSON
		...
	CASE "application/xml"
		// Traite le cas XML
		...
	OTHER CASE
		// Traite les autres cas (lance une erreur)
		// Indique que les données reçus sont dans un format non reconnu : 
		// 415 Unsupported Media Type
		WebserviceWriteHTTPCode(415, sErreur)
		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 file (*.pdf)
  • "image/gif": GIF image (*.gif)
  • "image/jpeg": JPEG image (*.jpg, *.jpeg)
  • "video/mpeg": MPEG video (*.mpg, *.mpeg)
  • "application/unknown": displays a dialog box offering to download the file to the user's computer.
  • "application/msword": Opens a Microsoft Word file.
  • "application/vnd.ms-excel": Opens a Microsoft 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: wd300awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 03/27/2025

Send a report | Local help