class Response

Response object.

Methods

__construct(string $content = '', integer $status = 200, array $headers = array())

Constructor.

string
__toString()

Converts the response object to string containing all headers and the response content.

string
getContent()

Gets the response content.

integer
getStatus()

Gets the response status code.

array
getHeaders()

Gets the response headers.

string|array
getHeader(string $header, Boolean $first = true)

Gets a response header.

Details

at line line 39
__construct(string $content = '', integer $status = 200, array $headers = array())

Constructor.

The headers array is a set of key/value pairs. If a header is present multiple times then the value is an array of all the values.

Parameters

string $content The content of the response
integer $status The response status code
array $headers An array of headers

at line line 51
string __toString()

Converts the response object to string containing all headers and the response content.

Return Value

string The response with headers and content

at line line 87
string getContent()

Gets the response content.

Return Value

string The response content

at line line 99
integer getStatus()

Gets the response status code.

Return Value

integer The response status code

at line line 111
array getHeaders()

Gets the response headers.

Return Value

array The response headers

at line line 124
string|array getHeader(string $header, Boolean $first = true)

Gets a response header.

Parameters

string $header The header name
Boolean $first Whether to return the first value or all header values

Return Value

string|array The first header value if $first is true, an array of values otherwise