GetResponseStatusCode

Description

Gets the response status code.

Applies to

HTTPClient and RestClient objects

Syntax

objectname.GetResponseStatusCode ( )

Argument

Description

objectname

The name of the HTTPClient or RestClient object for which you want to get the response status code


Return value

Long.

Returns the response status code.

Examples

This example gets the response status:

Integer li_rc
Long ll_StatusCode
String ls_ContentType
Blob lblb_blob
HttpClient lnv_HttpClient
lnv_HttpClient = Create HttpClient

// Send request using GET method
li_rc = lnv_HttpClient.SendRequest("GET", "http://demo.appeon.com/PB/webapi_client/employee/102")

// Obtain the response message
if li_rc = 1 then
 // Obtain the response status
 ll_StatusCode = lnv_HttpClient.GetResponseStatusCode()
 if ll_StatusCode = 200 then
  // Obtain headers
  ls_ContentType = lnv_HttpClient.GetResponseHeader("Content-Type") // Obtain the specified header
  // Obtain the response data
  lnv_HttpClient.GetResponseBody(lblb_blob)
  ...
 end if
end if

See also

GetResponseBody

GetResponseHeader

GetResponseHeaders

GetResponseStatusText