\baiduResponseCore

Container for all response-related methods.

Summary

Methods
Properties
Constants
__construct()
isOK()
$header
$body
$status
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Properties

$header

$header

Stores the HTTP header information.

$body

$body

Stores the SimpleXML response.

$status

$status

Stores the HTTP response code.

Methods

__construct()

__construct(array  $header, string  $body, int  $status = null) : object

Constructs a new instance of this class.

Parameters

array $header

(Required) Associative array of HTTP headers (typically returned by baiduRequestCore::get_response_header()).

string $body

(Required) XML-formatted response from AWS.

int $status

(Optional) HTTP response status code from the request.

Returns

object —

Contains an php:array header property (HTTP headers as an associative array), a php:SimpleXMLElement or php:string body property, and an php:integer status code.

isOK()

isOK(int|array  $codes = array(200, 201, 204, 206)) : bool

Did we receive the status code we expected?

Parameters

int|array $codes

(Optional) The status code(s) to expect. Pass an php:integer for a single acceptable value, or an php:array of integers for multiple acceptable values.

Returns

bool —

Whether we received the expected status code or not.