PHP Class ResponseCore

Datei anzeigen Open project: zblogcn/zblogphp Class Usage Examples

Public Properties

Property Type Description
$body Stores the SimpleXML response.
$header Stores the HTTP header information.
$status Stores the HTTP response code.

Public Methods

Method Description
__construct ( array $header, string $body, integer $status = null ) : object Constructs a new instance of this class.
isOK ( integer | array $codes = [200, 201, 204, 206] ) : boolean Did we receive the status code we expected?

Method Details

__construct() public method

Constructs a new instance of this class.
public __construct ( array $header, string $body, integer $status = null ) : object
$header array (Required) Associative array of HTTP headers (typically returned by ).
$body string (Required) XML-formatted response from AWS.
$status integer (Optional) HTTP response status code from the request.
return object Contains an `header` property (HTTP headers as an associative array), a or `body` property, and an `status` code.

isOK() public method

Did we receive the status code we expected?
public isOK ( integer | array $codes = [200, 201, 204, 206] ) : boolean
$codes integer | array (Optional) The status code(s) to expect. Pass an for a single acceptable value, or an of integers for multiple acceptable values.
return boolean Whether we received the expected status code or not.

Property Details

$body public_oe property

Stores the SimpleXML response.
public $body

$header public_oe property

Stores the HTTP header information.
public $header

$status public_oe property

Stores the HTTP response code.
public $status