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
WebserviceWriteMIMEType (Function)
In french: WebserviceEcritTypeMIME
AjaxNot available
Indicates the MIME type of the response returned by the web service (case of a call to a REST web service).
Example
// Retourne soit du JSON, soit du XML soit rien
IF bRetourJSON THEN
	WebserviceWriteMIMEType("application/json")
	RETURN ...
ELSE IF bRetourXML THEN 
	WebserviceWriteMIMEType("application/xml")
	RETURN ...
ELSE
	WebserviceWriteHTTPCode(204)
END
Syntax
WebserviceWriteMIMEType(<MIME type>)
<MIME type>: Character string or Integer constant
MIME type of the response returned by the web service.
Hundreds of types are defined in the MIME communication standard (available on the Internet).
  • MIME type expressed as a character string. 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.
  • MIME type corresponding to one of the following constants:
    mimeTypeXMLApplicationXML content.
    mimeTypeBinaryBinary content (byte stream).
    mimeTypeDOCWord file (*.doc)
    mimeTypeDOCXWord file (*.docx)
    mimeTypeGIFGIF image (*.gif)
    mimeTypeHTMLHTML page (*.htm, *.html)
    mimeTypeJPEGJPEG image (*.jpg, *.jpeg)
    mimeTypeJSONJSON content.
    mimeTypePDFPDF document (*.pdf)
    mimeTypePNGImage content in PNG format (*.png)
    mimeTypeSOAPSOAP content in XML format.
    mimeTypeTextText (*.txt)
    mimeTypeXMLTextXML text
    mimeTypeXLSExcel file (*.xls)
    mimeTypeXLSXExcel file (*.xlsx)
    mimeTypeZIPZIP file (*.zip)
Remarks
This function is only available when calling a function that processes a REST web service request. In other cases, the function has no effect.
Component: wd300awws.dll
Minimum version required
  • Version 22
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 05/14/2025

Send a report | Local help