\Pop\Auth\HttpResponse

Auth HTTP response class

Summary

Methods
Properties
Constants
setVersion()
setCode()
setMessage()
setHeaders()
setHeader()
setBody()
getVersion()
getCode()
getMessage()
getHeaders()
getHeader()
getBody()
sendRequest()
decodeBody()
decodeChunkedBody()
No public properties found
No constants found
No protected methods found
$version
$code
$message
$headers
$body
N/A
No private methods found
No private properties found
N/A

Properties

$version

$version : string

HTTP version

Type

string

$code

$code : integer

Response code

Type

integer

$message

$message : string

Response message

Type

string

$headers

$headers : array

Response headers

Type

array

$body

$body : string

Response body

Type

string

Methods

setVersion()

setVersion(string  $version) : \Pop\Auth\Http\Response

Set the HTTP version

Parameters

string $version

Returns

\Pop\Auth\Http\Response

setCode()

setCode(string  $code) : \Pop\Auth\Http\Response

Get the HTTP code

Parameters

string $code

Returns

\Pop\Auth\Http\Response

setMessage()

setMessage(string  $message) : \Pop\Auth\Http\Response

Set the HTTP message

Parameters

string $message

Returns

\Pop\Auth\Http\Response

setHeaders()

setHeaders(array  $headers) : \Pop\Auth\Http\Response

Set the HTTP response headers

Parameters

array $headers

Returns

\Pop\Auth\Http\Response

setHeader()

setHeader(string  $name, mixed  $value) : \Pop\Auth\Http\Response

Set an HTTP response header

Parameters

string $name
mixed $value

Returns

\Pop\Auth\Http\Response

setBody()

setBody(  $body) : \Pop\Auth\Http\Response

Set the HTTP response body

Parameters

$body

Returns

\Pop\Auth\Http\Response

getVersion()

getVersion() : string

Get the HTTP version

Returns

string

getCode()

getCode() : string

Get the HTTP code

Returns

string

getMessage()

getMessage() : string

Get the HTTP message

Returns

string

getHeaders()

getHeaders() : array

Get the HTTP response headers

Returns

array

getHeader()

getHeader(string  $name) : mixed

Get an HTTP response header

Parameters

string $name

Returns

mixed

getBody()

getBody() : string

Get the HTTP response body

Returns

string

sendRequest()

sendRequest(string  $uri, array  $context = null, array  $contextParams = null) : void

Send the request

Parameters

string $uri
array $context
array $contextParams

decodeBody()

decodeBody(string  $body, string  $decode = 'gzip') : string

Decode the body data.

Parameters

string $body
string $decode

Throws

\Pop\Auth\Http\Exception

Returns

string

decodeChunkedBody()

decodeChunkedBody(string  $body) : string

Decode a chunked transfer-encoded body and return the decoded text

Parameters

string $body

Returns

string