class CurlClientResponse (View source)

Constants

STATUS_OK

STATUS_CREATED

STATUS_ACCEPTED

STATUS_NON_AUTHORITATIVE_INFORMATION

STATUS_NO_CONTENT

STATUS_RESET_CONTENT

STATUS_PARTIAL_CONTENT

Properties

protected $headers
protected $rawHeaders
protected $statusCode
protected $body
protected $protocol

Methods

__construct(String $response)

Constructs a new object from an existing HTTP response.

__toString()

No description

String
getBody()

Returns the body of the response.

string
getHeader(string $header)

Returns the value of the specified header.

array
getCookies()

Returns the cookies set in the current response.

String
getResponse()

Returns the whole response.

String
getValidStatusCodes()

Returns an array for the HTTP status codes that are considered as valid responses.

buildHeaders(string $headers)

Builds headers array from a well-formatted string.

string
getRawHeaders()

Returns all the headers as a string.

setProtocol(string $protocol)

Sets the protocol used for the communication with the client.

string
getProtocol()

Returns the protocol used to communicate with the client.

setStatusCode(integer $code)

Sets the status code of the response.

String
getStatusCode()

Returns the status code of the response.

Details

__construct(String $response)

Constructs a new object from an existing HTTP response.

Parameters

String $response

__toString()

String getBody()

Returns the body of the response.

Return Value

String

string getHeader(string $header)

Returns the value of the specified header.

Parameters

string $header Header name.

Return Value

string

array getCookies()

Returns the cookies set in the current response.

Return Value

array

String getResponse()

Returns the whole response.

Return Value

String

String getValidStatusCodes()

Returns an array for the HTTP status codes that are considered as valid responses.

Return Value

String

protected buildHeaders(string $headers)

Builds headers array from a well-formatted string.

Parameters

string $headers

protected string getRawHeaders()

Returns all the headers as a string.

Return Value

string

protected setProtocol(string $protocol)

Sets the protocol used for the communication with the client.

Parameters

string $protocol

string getProtocol()

Returns the protocol used to communicate with the client.

Return Value

string

protected setStatusCode(integer $code)

Sets the status code of the response.

Parameters

integer $code

String getStatusCode()

Returns the status code of the response.

Return Value

String