Description
Gets the response status description.
Applies to
HTTPClient and RestClient objects
Syntax
objectname.GetResponseStatusText ( )
Argument |
Description |
---|---|
objectname |
The name of the HTTPClient or RestClient object for which you want to get the response status description |
Return value
String.
Returns the response status description.
The return value will be empty when HTTP/2 is enabled. The HTTP response will not include the response status description information when HTTP/2 is enabled (which is enabled by default for the HTTPClient/RestClient object), because HTTP/2 does not define a way to carry the version or reason phrase that is included in an HTTP/1.1 status line. For more, refer to RFC 7540: Hypertext Transfer Protocol Version 2 (HTTP/2). If you need to obtain the response status description information, you can disable HTTP/2 by setting the "EnableHttp2" property of the HTTPClient/RestClient object to "False".
Examples
This example gets the response status description:
Integer li_rc, li_StatusCode String ls_StatusText Blob lblb_blob HttpClient lnv_HttpClient lnv_HttpClient = Create HttpClient // Send request using GET method li_rc = lnv_HttpClient.SendRequest("GET", "https://demo.appeon.com/PB/webapi_client/employee/102") // Obtain the response message if li_rc = 1 then // Obtain the response status li_StatusCode = lnv_HttpClient.GetResponseStatusCode() ls_StatusText = lnv_HttpClient.GetResponseStatusText() // Obtain the response data lnv_HttpClient.GetResponseBody(lblb_blob) … end if
See also