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
WebserviceWriteCustomHTTPCode (Function)
In french: WebserviceEcritCodeHTTPPersonnalisé
AjaxNot available
Specifies the custom HTTP code that will be returned when the execution of the REST web service function is completed. This function allows you to specify any code between 100 and 599, including the following return codes:
  • 2xx codes for Successful responses.
  • 3xx codes for Redirections.
  • 4xx codes for Client errors.
  • 5xx codes for Server errors.
Example
// Indicates a token error
WebserviceWriteCustomHTTPCode("498 Invalid Token")
Syntax
WebserviceWriteCustomHTTPCode(<HTTP code and description> [, <Additional information>])
<HTTP code and description>: Character string
HTTP code and its description, returned by the current web service call. The expected format is as follows:
<HTTP code> <Description>
For example: "498 Invalid Token". Supported codes range from 100 to 599.
<Additional information>: Optional character string
Additional information required by some return codes. The return codes are as follows:
  • 201 (Created): optional information: Address of added information.
  • 301 (Moved Permanently): required information: Redirection address.
  • 302 (Moved Temporarily): required information: Redirection address.
  • 4xx and 5xx: required information: Text of the error returned to the client. The text will be converted to UTF-8.
Remarks
  • This function is useful when the REST web service call must return a non-standard code not supported by WebserviceWriteHTTPCode.
  • This function is only available when calling a function that processes a REST web service request. In all other cases, the function causes an error.
Component: wd290awws.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment

Last update: 01/10/2024

Send a report | Local help