Properties

$headers

$headers : array

Headers

Type

array

$responseCodes

$responseCodes : array

Response codes & messages

Type

array

$version

$version : string

HTTP version for response, i.e. 1.0, 1.1, 2.0, 3.0, etc.

Type

string

$code

$code : integer

Response code

Type

integer

$message

$message : string

Response message

Type

string

Methods

addHeader()

addHeader(\Pop\Mime\Part\Header|string  $header, string  $value = null) : \Pop\Http\AbstractHttp

Add a header

Parameters

\Pop\Mime\Part\Header|string $header
string $value

Returns

\Pop\Http\AbstractHttp

addHeaders()

addHeaders(array  $headers) : \Pop\Http\AbstractHttp

Add all headers

Parameters

array $headers

Returns

\Pop\Http\AbstractHttp

getHeader()

getHeader(string  $name) : mixed

Get a header

Parameters

string $name

Returns

mixed

getHeaderValue()

getHeaderValue(string  $name) : mixed

Get header value

Parameters

string $name

Returns

mixed

getHeaders()

getHeaders() : array

Get all headers

Returns

array

getHeadersAsArray()

getHeadersAsArray() : array

Get all header values as associative array

Returns

array

getHeadersAsString()

getHeadersAsString(string  $status = null, string  $eol = "\r\n") : string

Get all header values formatted string

Parameters

string $status
string $eol

Returns

string

hasHeaders()

hasHeaders() : boolean

Determine if there are headers

Returns

boolean

hasHeader()

hasHeader(string  $name) : boolean

Has a header

Parameters

string $name

Returns

boolean

removeHeader()

removeHeader(string  $name) : \Pop\Http\AbstractHttp

Remove a header

Parameters

string $name

Returns

\Pop\Http\AbstractHttp

getBodyContent()

getBodyContent() : mixed

Get body content

Returns

mixed

hasBody()

hasBody() : boolean

Has a body

Returns

boolean

hasBodyContent()

hasBodyContent() : boolean

Has body content

Returns

boolean

decodeBodyContent()

decodeBodyContent(string  $body = null) : \Pop\Mime\Part\Body

Decode the body

Parameters

string $body

Returns

\Pop\Mime\Part\Body

__get()

__get(string  $name) : mixed

Magic method to get either the headers or body

Parameters

string $name

Returns

mixed

__construct()

__construct(array  $config = array()) 

Constructor

Instantiate the response object

Parameters

array $config

setVersion()

setVersion(float|string  $version) : \Pop\Http\AbstractResponse

Set the response version

Parameters

float|string $version

Returns

\Pop\Http\AbstractResponse

getVersion()

getVersion() : float|string

Get the response HTTP version

Returns

float|string

setCode()

setCode(integer  $code = 200) : \Pop\Http\AbstractResponse

Set the response code

Parameters

integer $code

Throws

\Pop\Http\Exception

Returns

\Pop\Http\AbstractResponse

getCode()

getCode() : string

Get the response code

Returns

string

setMessage()

setMessage(string  $message = null) : \Pop\Http\AbstractResponse

Set the response message

Parameters

string $message

Returns

\Pop\Http\AbstractResponse

getMessage()

getMessage() : string

Get the response HTTP message

Returns

string

isSuccess()

isSuccess() : boolean

Determine if the response is a success

Returns

boolean

isRedirect()

isRedirect() : boolean

Determine if the response is a redirect

Returns

boolean

isError()

isError() : boolean

Determine if the response is an error

Returns

boolean

isClientError()

isClientError() : boolean

Determine if the response is a client error

Returns

boolean

isServerError()

isServerError() : boolean

Determine if the response is a server error

Returns

boolean