Class: GDHttpResponse

GDHttpResponse(json) → {GDHttpResponse}

This class encapsulates the HTTP response returned from a GDHttpRequest's send function.

Constructor

new GDHttpResponse(json) → {GDHttpResponse}

Parameters:
Name Type Description
json string The input data (formatted as JSON text) used to construct the response object.
Properties:
Name Type Description
headers string The HTTP response headers.
status string The HTTP response status.
statusText string The textual HTTP response status, as sent by the server, or details of error if the returned status is 0.
responseText string The data returned from the HTTP request. This data is retrieved from the JSON string that was passed into this function. If the input to this function is not in valid JSON format, then this property will be the empty string.
responseData string This is the raw (unparsed) data that was passed into this function. This data is useful as a means to support manual processing/parsing if the input data could not be parsed as a JSON object.
responseState string This value represents the current state of the opened HTTP process. The response is not complete until the responseState reaches the "DONE" state. The following states are valid:
  • "HEADERS_RECEIVED" Response headers have been received.
  • "LOADING" Response headers and some data have been received. The loading state is typically indicative of an incremental request that is in progress.
  • "DONE" All data has been received, or a permanent error has been encountered.
Source:
Returns:
Type
GDHttpResponse
Example
// This object is used by GDHttpRequest.parseHttpResponse() method and is not used directly