TarzanHTTPResponse

Converts the HTTP responses into organized data chunks.

Version

2008.11.27

Copyright

2006-2008 LifeNexus Digital, Inc., and contributors.

License

Simplified BSD Licensehttp://opensource.org/licenses/bsd-license.php

See Also

Tarzanhttp://tarzan-aws.com

TarzanHTTPResponse

Container for all response-related methods.

Properties

header

Stores the HTTP header information.

body

Stores the SimpleXML response.

status

Stores the HTTP response code.

Functions

__construct()

public function __construct($header,  
$body,  
$status =  null)

The constructor

Access

public

Parameters

headerarray (Required) Associative array of HTTP headers (typically returned by TarzanHTTPRequest::getResponseHeader()).
bodystring (Required) XML-formatted response from AWS.
statusinteger (Optional) HTTP response status code from the request.

Returns

object Contains an array ‘header’ property (HTTP headers as an associative array), a SimpleXMLElement ‘body’ property, and an integer ‘status’ code.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/httpresponse/httpresponse.phps

isOK()

public function isOK($codes =  array(200, 201, 204))

Did we receive the status code we expected?

Access

public

Parameters

codesinteger|array (Optional) The status code(s) to expect.  Pass an integer for a single acceptable value, or an array of integers for multiple acceptable values.  Defaults to array 200|204.

Returns

boolean Whether we received the expected status code or not.

See Also

Example Usagehttp://tarzan-aws.com/docs/examples/httpresponse/httpresponse.phps