class BasicHandler extends ResponseHandler

Methods

boolean
wasErrored()

Check to see if the response was errored

boolean
wasFailed()

Check to see if the response failed

boolean
wasSuccessful()

Check to see if the response was successful (true) or failed/errored (false)

$this
filter(callable $callable)

Register a filter callback.

string
getCliCall()

Returns a CLI curl version of the request

integer
getCode()

Http status code for the response

mixed
getFilteredResponse()

Get the response after it has been sent through any filters

array
getHeaders()

Get the Http response headers

string
getHtmlVersion()

Get the Http response version

mixed
getRawResponse()

Get the raw response

info()

Provide access to the curlInfo property

initialize(string $rawResponse, string $htmlVersion, array $headers, integer $code, array $curlInfo, string $cliCall)

Called by the Client to initialize the response handler

Details

at line line 13
boolean wasErrored()

Check to see if the response was errored

Return Value

boolean

at line line 28
boolean wasFailed()

Check to see if the response failed

Return Value

boolean

at line line 45
boolean wasSuccessful()

Check to see if the response was successful (true) or failed/errored (false)

Return Value

boolean

in ResponseHandler at line line 81
$this filter(callable $callable)

Register a filter callback.

These are called after the response handler is initialized by the Client. The callback will receive the raw response as its first argument. Optional extra arguments may be passed here that will also be forwarded to the filter when invoked.

Parameters

callable $callable

Return Value

$this

in ResponseHandler at line line 93
string getCliCall()

Returns a CLI curl version of the request

Return Value

string

in ResponseHandler at line line 104
integer getCode()

Http status code for the response

Return Value

integer

in ResponseHandler at line line 115
mixed getFilteredResponse()

Get the response after it has been sent through any filters

Return Value

mixed

in ResponseHandler at line line 126
array getHeaders()

Get the Http response headers

Return Value

array

in ResponseHandler at line line 137
string getHtmlVersion()

Get the Http response version

Return Value

string

in ResponseHandler at line line 148
mixed getRawResponse()

Get the raw response

Return Value

mixed

in ResponseHandler at line line 159
CurlInfo info()

Provide access to the curlInfo property

Return Value

CurlInfo

in ResponseHandler at line line 175
initialize(string $rawResponse, string $htmlVersion, array $headers, integer $code, array $curlInfo, string $cliCall)

Called by the Client to initialize the response handler

Parameters

string $rawResponse
string $htmlVersion
array $headers
integer $code
array $curlInfo
string $cliCall