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
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
// Returns either JSON, or XML, or nothing
IF bReturnJSON THEN
WebserviceWriteMIMEType("application/json")
RETURN ...
ELSE IF bReturnXML 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 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.
  • 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)
    mimeTypePNGJPEG image (*.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: 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