PC SOFT

ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Home | Sign in | English EN
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 Webservice 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 Redirects.
  • 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 Webservice 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 affected return codes are as follows:
  • Code 201 (Created) : optional information : Address of added information.
  • Code 301 (Moved Permanently) : mandatory information : Redirection address.
  • Code 302 (Moved Temporarily) : mandatory information : Redirection address.
  • Codes 4xx and 5xx : mandatory information : Text of error returned to the client. The text will be converted into UTF-8.
Remarks
  • This function is useful when the REST webservice call must return a non-standard code not supported by WebserviceWriteHTTPCode.
  • This function is only available during the call to a function that processes a request of a REST Webservice. In all other cases, the function triggers an error.
Component: wd280awws.dll
Minimum version required
  • Version 27
This page is also available for…
Comments
Click [Add] to post a comment