\triagens\ArangoDbHttpResponse

Container class for HTTP responses


Summary

Methods
Properties
Constants
__construct()
getHttpCode()
getHeader()
getHeaders()
getLocationHeader()
getBody()
getResult()
getJson()
No public properties found
HEADER_LOCATION
No protected methods found
No protected properties found
N/A
No private methods found
$_header
$_body
$_headers
$_result
$_httpCode
N/A

Constants

HEADER_LOCATION

HEADER_LOCATION

HTTP location header

Properties

$_header

$_header : string

The header retrieved

Type

string

$_body

$_body : string

The body retrieved

Type

string

$_headers

$_headers : array

All headers retrieved as an assoc array

Type

array

$_result

$_result : string

The result status-line (first line of HTTP response header)

Type

string

$_httpCode

$_httpCode : integer

The HTTP status code of the response

Type

integer

Methods

__construct()

__construct(string $responseString)

Set up the response

Parameters

string $responseString
  • the complete HTTP response as supplied by the server

Throws

\triagens\ArangoDb\ClientException

getHttpCode()

getHttpCode() : integer

Return the HTTP status code of the response

Returns

integer —
  • HTTP status code of response

getHeader()

getHeader(string $name) : string

Return an individual HTTP headers of the response

Parameters

string $name
  • name of header

Returns

string —
  • header value, NULL if header wasn't set in response

getHeaders()

getHeaders() : array

Return the HTTP headers of the response

Returns

array —
  • array of all headers with values

getLocationHeader()

getLocationHeader() : string

Return the location HTTP header of the response

Returns

string —
  • header value, NULL is header wasn't set in response

getBody()

getBody() : string

Return the body of the response

Returns

string —
  • body of the response

getResult()

getResult() : string

Return the result line (first header line) of the response

Returns

string —
  • the result line (first line of header)

getJson()

getJson() : array

Return the data from the JSON-encoded body

Throws

\triagens\ArangoDb\ClientException

Returns

array —
  • array of values from the JSON-encoded response body