Home | Sign in | English EN
  • Details of usable codes
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WindowsLinuxPHPWEBDEV - Browser code
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Stored procedures
WebserviceWriteHTTPCode (Function)
In french: WebserviceEcritCodeHTTP
AjaxNot available
Fills the HTTP code that will be returned at the end of execution of REST Webservice function. This function is used to specify some categories of return codes:
  • Codes 2xx to manage Successful responses.
  • Codes 3xx to manage Redirects.
  • Codes 4xx to manage Client errors.
  • Codes 5xx to manage Server errors.
// Indicates the client creation : 201 Created
WebserviceWriteHTTPCode(201, "https://server/Client/" + Client.id)
// And returns the client details
RESULT sClient
// Indicates the absence of response : 204 No Content
// And returns no response
// Accepts a JSON or XML content
SWITCH WebserviceReadMIMEType()
CASE "application/json"
// Processes the JSON case
CASE "application/xml"
// Processes the XML case
// Processes the other cases (triggers an error)
// Indicates that the format of received data is in unknown :
// 415 Unsupported Media Type
WebserviceWriteHTTPCode(415, sError)
WebserviceWriteHTTPCode(<HTTP Code> [, <Additional information>])
<HTTP Code>: Integer
HTTP code returned by the call to the Webservice. The following codes are accepted:
  • Codes 2xx (Successful responses)
  • Codes 3xx (Redirects)
  • Codes 4xx (Client errors)
  • Codes 5xx (Server errors)
For more details, see Details of usable codes.
<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.
  • This function is useful if the call to the REST Webservice must return a code other than 200.
  • The WEBDEV application server automatically generates a code 4xx or 5xx for the detected errors.
  • This function is only available during the call to a function that processes a request of a REST Webservice. In the other cases, the function triggers an error.

Details of usable codes

The following HTTP codes returned by the call to the Webservice are accepted:
  • Codes 2xx (Successful responses)
    • 200 OK
    • 201 Created
    • 204 No Content
  • Codes 3xx (Redirects)
    • 301 Moved Permanently
    • 302 Moved Temporarily
  • Codes 4xx (Client errors)
    • 400 Bad Request
    • 401 Unauthorized
    • 403 Forbidden
    • 404 Not Found
    • 405 Method Not Allowed
    • 406 Not Acceptable
    • 415 Unsupported Media Type
  • Codes 5xx (Server errors)
    • 500 Internal Server Error
    • 501 Not Implemented
    • 503 Service Unavailable
Component: wd270awws.dll
Minimum version required
  • Version 22
This page is also available for…
Click [Add] to post a comment