summaryrefslogtreecommitdiff
path: root/zend/documentation/api/core/files/Http.Response.html
blob: 165749b4245d397e630b91232131e7e075c0386a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Zend Gdata API Documentation</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta><link rel="stylesheet" href="../css/template.css" type="text/css"></link><script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script><script type="text/javascript" src="../js/jquery.tools.min.js"></script><script type="text/javascript" src="../js/jquery-ui-1.8.2.custom.min.js"></script><script type="text/javascript" src="../js/template.js"></script></head><body><div id="content"><h1 class="file">Http/Response.php</h1><div id="file-nav-box"><div id="file-nav-options">
              Show:
              <img src="../images/icons/visibility_public.png" alt="Public" id="show-public"></img><img src="../images/icons/visibility_protected.png" alt="Protected" id="show-protected"></img><img src="../images/icons/visibility_private.png" alt="Private" id="show-private"></img><span class="attribute" id="show-inherited">inherited</span></div><div id="file-nav-container"><ul id="file-nav"><li><a href="#classes"><img src="../images/icons/class.png" alt="Class" height="14"></img>
                          Classes
                      </a><ul><li><a href="#\Zend_Http_Response">\Zend_Http_Response</a></li></ul></li></ul><div style="clear: left;"></div></div><div id="file-nav-tab">
              Table of Contents
          </div></div><a name="top" class="anchor"></a><div id="file-description"><div class="short-description">Zend Framework</div><div class="long-description"><p>LICENSE</p>

<p>This source file is subject to the new BSD license that is bundled
with this package in the file LICENSE.txt.
It is also available through the world-wide-web at this URL:
http://framework.zend.com/license/new-bsd
If you did not receive a copy of the license and are unable to
obtain it through the world-wide-web, please send an email
to license@zend.com so we can send you a copy immediately.</p></div></div><dl class="file-info"><dt>Category</dt><dd>Zend
         
    </dd><dt>Copyright</dt><dd>Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd><dt>License</dt><dd><a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd><dt>Package</dt><dd>Zend_Http
         
    </dd><dt>Subpackage</dt><dd>Response
         
    </dd><dt>Version</dt><dd>$Id: Response.php 25081 2012-11-06 20:59:47Z rob $
         
    </dd></dl><a name="classes" class="anchor"></a><a id="\Zend_Http_Response" class="anchor"></a><h2 class="class">\Zend_Http_Response<div class="to-top"><a href="#top">jump to top</a></div></h2><div class="class"><small class="package"><b>Package: </b>Zend\Http\Response</small><div class="short-description">Zend_Http_Response represents an HTTP 1.0 / 1.1 response message.</div><div class="long-description"><p>It
includes easy access to all the response's different elemts, as well as some
convenience methods for parsing and validating HTTP responses.</p></div><dl class="class-info"><dt>Children</dt><dd><a href="../files/Http.Response.Stream.html#\Zend_Http_Response_Stream">\Zend_Http_Response_Stream</a></dd><dt>Copyright</dt><dd>Copyright (c) 2005-2012 Zend Technologies USA Inc. (http://www.zend.com)
         
    </dd><dt>License</dt><dd><a href="http://framework.zend.com/license/new-bsd">New BSD License</a>
         
    </dd></dl><h3>Properties</h3><div><a id="\Zend_Http_Response::$body" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>string <span class="highlight">$body</span></code><div class="description"><div class="short-description">The HTTP response body</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Response::$code" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>int <span class="highlight">$code</span></code><div class="description"><div class="short-description">The HTTP response code</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>int</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Response::$headers" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>array <span class="highlight">$headers</span> = array()</code><div class="description"><div class="short-description">The HTTP response headers array</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array()</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Response::$message" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>string <span class="highlight">$message</span></code><div class="description"><div class="short-description">The HTTP response code as string
(e.g.</div></div><div class="code-tabs"><div class="long-description"><p>'Not Found' for 404 or 'Internal Server Error' for 500)</p></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Response::$messages" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>array <span class="highlight">$messages</span> = array(100 =&gt; 'Continue', 101 =&gt; 'Switching Protocols', 200 =&gt; 'OK', 201 =&gt; 'Created', 202 =&gt; 'Accepted', 203 =&gt; 'Non-Authoritative Information', 204 =&gt; 'No Content', 205 =&gt; 'Reset Content', 206 =&gt; 'Partial Content', 300 =&gt; 'Multiple Choices', 301 =&gt; 'Moved Permanently', 302 =&gt; 'Found', 303 =&gt; 'See Other', 304 =&gt; 'Not Modified', 305 =&gt; 'Use Proxy', 307 =&gt; 'Temporary Redirect', 400 =&gt; 'Bad Request', 401 =&gt; 'Unauthorized', 402 =&gt; 'Payment Required', 403 =&gt; 'Forbidden', 404 =&gt; 'Not Found', 405 =&gt; 'Method Not Allowed', 406 =&gt; 'Not Acceptable', 407 =&gt; 'Proxy Authentication Required', 408 =&gt; 'Request Timeout', 409 =&gt; 'Conflict', 410 =&gt; 'Gone', 411 =&gt; 'Length Required', 412 =&gt; 'Precondition Failed', 413 =&gt; 'Request Entity Too Large', 414 =&gt; 'Request-URI Too Long', 415 =&gt; 'Unsupported Media Type', 416 =&gt; 'Requested Range Not Satisfiable', 417 =&gt; 'Expectation Failed', 500 =&gt; 'Internal Server Error', 501 =&gt; 'Not Implemented', 502 =&gt; 'Bad Gateway', 503 =&gt; 'Service Unavailable', 504 =&gt; 'Gateway Timeout', 505 =&gt; 'HTTP Version Not Supported', 509 =&gt; 'Bandwidth Limit Exceeded')</code><div class="description"><span class="attribute">static</span><div class="short-description">List of all known HTTP response codes - used by responseCodeAsText() to
translate numeric codes to messages.</div></div><div class="code-tabs"><div class="long-description"></div><strong>Default value</strong><code>array(100 =&gt; 'Continue', 101 =&gt; 'Switching Protocols', 200 =&gt; 'OK', 201 =&gt; 'Created', 202 =&gt; 'Accepted', 203 =&gt; 'Non-Authoritative Information', 204 =&gt; 'No Content', 205 =&gt; 'Reset Content', 206 =&gt; 'Partial Content', 300 =&gt; 'Multiple Choices', 301 =&gt; 'Moved Permanently', 302 =&gt; 'Found', 303 =&gt; 'See Other', 304 =&gt; 'Not Modified', 305 =&gt; 'Use Proxy', 307 =&gt; 'Temporary Redirect', 400 =&gt; 'Bad Request', 401 =&gt; 'Unauthorized', 402 =&gt; 'Payment Required', 403 =&gt; 'Forbidden', 404 =&gt; 'Not Found', 405 =&gt; 'Method Not Allowed', 406 =&gt; 'Not Acceptable', 407 =&gt; 'Proxy Authentication Required', 408 =&gt; 'Request Timeout', 409 =&gt; 'Conflict', 410 =&gt; 'Gone', 411 =&gt; 'Length Required', 412 =&gt; 'Precondition Failed', 413 =&gt; 'Request Entity Too Large', 414 =&gt; 'Request-URI Too Long', 415 =&gt; 'Unsupported Media Type', 416 =&gt; 'Requested Range Not Satisfiable', 417 =&gt; 'Expectation Failed', 500 =&gt; 'Internal Server Error', 501 =&gt; 'Not Implemented', 502 =&gt; 'Bad Gateway', 503 =&gt; 'Service Unavailable', 504 =&gt; 'Gateway Timeout', 505 =&gt; 'HTTP Version Not Supported', 509 =&gt; 'Bandwidth Limit Exceeded')</code><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>array</dd></dl></div><div class="clear"></div></div><a id="\Zend_Http_Response::$version" class="anchor"></a><div class="property protected"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png" alt="&gt;"></img><img src="../images/icons/arrow_down.png" alt="V" style="display: none;"></img></a><code class="title"><img src="../images/icons/property.png" alt="Property"></img><img src="../images/icons/visibility_protected.png" style="margin-right: 5px" alt="protected"></img>string <span class="highlight">$version</span></code><div class="description"><div class="short-description">The HTTP version (1.0, 1.1)</div></div><div class="code-tabs"><div class="long-description"></div><strong>Details</strong><dl class="property-info"><dt>Type</dt><dd>string</dd></dl></div><div class="clear"></div></div></div><h3>Methods</h3><div><a id="\Zend_Http_Response::__construct()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">__construct</span><span class="nb-faded-text">(int $code, array $headers, string $body = null, string $version = '1.1', string $message = null)</span> : void</code><div class="description"><p class="short_description">HTTP response constructor</p></div><div class="code-tabs"><div class="long-description"><p>In most cases, you would use Zend_Http_Response::fromString to parse an HTTP
response string and create a new Zend_Http_Response object.</p>

<p>NOTE: The constructor no longer accepts nulls or empty values for the code and
headers and will throw an exception if the passed values do not form a valid HTTP
responses.</p>

<p>If no message is passed, the message will be guessed according to the response code.</p></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$code</th><td>int</td><td><em><p>Response code (200, 404, ...)</p>
</em></td></tr><tr><th>$headers</th><td>array</td><td><em><p>Headers array</p></em></td></tr><tr><th>$body</th><td>string</td><td><em><p>Response body</p></em></td></tr><tr><th>$version</th><td>string</td><td><em><p>HTTP version</p></em></td></tr><tr><th>$message</th><td>string</td><td><em><p>Response code as text</p></em></td></tr></table><strong>Throws</strong><table class="argument-info"><thead><tr><th>Exception</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Exception.html#\Zend_Http_Exception">\Zend_Http_Exception</a></td><td><em></em></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::__toString()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">__toString</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Implements magic __toString()</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::asString()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">asString</span><span class="nb-faded-text">(string $br = "\n")</span> : string</code><div class="description"><p class="short_description">Get the entire response as string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$br</th><td>string</td><td><em><p>Line breaks (eg. "\n", "\r\n", "<br />")</p>
</em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::decodeChunkedBody()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">decodeChunkedBody</span><span class="nb-faded-text">(string $body)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Decode a "chunked" transfer-encoded body and return the decoded text</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$body</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::decodeDeflate()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">decodeDeflate</span><span class="nb-faded-text">(string $body)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Decode a zlib deflated message (when Content-encoding = deflate)</p></div><div class="code-tabs"><div class="long-description"><p>Currently requires PHP with zlib support</p></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$body</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::decodeGzip()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">decodeGzip</span><span class="nb-faded-text">(string $body)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Decode a gzip encoded message (when Content-encoding = gzip)</p></div><div class="code-tabs"><div class="long-description"><p>Currently requires PHP with zlib support</p></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$body</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::extractBody()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">extractBody</span><span class="nb-faded-text">(string $response_str)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Extract the body from a response string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::extractCode()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">extractCode</span><span class="nb-faded-text">(string $response_str)</span> : int</code><div class="description"><span class="attribute">static</span><p class="short_description">Extract the response code from a response string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>int</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::extractHeaders()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">extractHeaders</span><span class="nb-faded-text">(string $response_str)</span> : array</code><div class="description"><span class="attribute">static</span><p class="short_description">Extract the headers from a response string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>array</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::extractMessage()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">extractMessage</span><span class="nb-faded-text">(string $response_str)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Extract the HTTP message from a response</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::extractVersion()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">extractVersion</span><span class="nb-faded-text">(string $response_str)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">Extract the HTTP version from a response</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::fromString()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">fromString</span><span class="nb-faded-text">(string $response_str)</span> : <a href="../files/Http.Response.html#\Zend_Http_Response">\Zend_Http_Response</a></code><div class="description"><span class="attribute">static</span><p class="short_description">Create a new Zend_Http_Response object from a string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$response_str</th><td>string</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td><a href="../files/Http.Response.html#\Zend_Http_Response">\Zend_Http_Response</a></td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getBody()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getBody</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Get the response body as string</p></div><div class="code-tabs"><div class="long-description"><p>This method returns the body of the HTTP response (the content), as it
should be in it's readable version - that is, after decoding it (if it
was decoded), deflating it (if it was gzip compressed), etc.</p>

<p>If you want to get the raw body (as transfered on wire) use
$this->getRawBody() instead.</p></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getHeader()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getHeader</span><span class="nb-faded-text">(\string$header $header)</span> : string | array | null</code><div class="description"><p class="short_description">Get a specific header as string, or null if it is not set</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$header</th><td>\string$header</td><td><em></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string | array | null</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getHeaders()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getHeaders</span><span class="nb-faded-text">()</span> : array</code><div class="description"><p class="short_description">Get the response headers</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>array</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getHeadersAsString()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getHeadersAsString</span><span class="nb-faded-text">(boolean $status_line = true, string $br = "\n")</span> : string</code><div class="description"><p class="short_description">Get all headers as string</p></div><div class="code-tabs"><div class="long-description"></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$status_line</th><td>boolean</td><td><em><p>Whether to return the first status line (IE "HTTP 200 OK")</p>
</em></td></tr><tr><th>$br</th><td>string</td><td><em><p>Line breaks (eg. "\n", "\r\n", "<br />")</p>
</em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getMessage()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getMessage</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Return a message describing the HTTP response code
(Eg.</p></div><div class="code-tabs"><div class="long-description"><p>"OK", "Not Found", "Moved Permanently")</p></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getRawBody()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getRawBody</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Get the raw response body (as transfered "on wire") as string</p></div><div class="code-tabs"><div class="long-description"><p>If the body is encoded (with Transfer-Encoding, not content-encoding -
IE "chunked" body), gzip compressed, etc. it will not be decoded.</p></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getStatus()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getStatus</span><span class="nb-faded-text">()</span> : int</code><div class="description"><p class="short_description">Get the HTTP response status code</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>int</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::getVersion()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">getVersion</span><span class="nb-faded-text">()</span> : string</code><div class="description"><p class="short_description">Get the HTTP version of the response</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::isError()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">isError</span><span class="nb-faded-text">()</span> : boolean</code><div class="description"><p class="short_description">Check whether the response is an error</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>boolean</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::isRedirect()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">isRedirect</span><span class="nb-faded-text">()</span> : boolean</code><div class="description"><p class="short_description">Check whether the response is a redirection</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>boolean</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::isSuccessful()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">isSuccessful</span><span class="nb-faded-text">()</span> : boolean</code><div class="description"><p class="short_description">Check whether the response in successful</p></div><div class="code-tabs"><div class="long-description"></div><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>boolean</td><td></td></tr></table></div><div class="clear"></div></div><a id="\Zend_Http_Response::responseCodeAsText()" class="anchor"></a><div class="method public"><a href="#" class="gripper"><img src="../images/icons/arrow_right.png"></img><img src="../images/icons/arrow_down.png" style="display: none;"></img></a><code class="title"><img src="../images/icons/method.png" alt="method" title="method"></img><img src="../images/icons/visibility_public.png" style="margin-right: 5px" alt="public"></img><span class="highlight">responseCodeAsText</span><span class="nb-faded-text">(int $code = null, boolean $http11 = true)</span> : string</code><div class="description"><span class="attribute">static</span><p class="short_description">A convenience function that returns a text representation of
HTTP response codes.</p></div><div class="code-tabs"><div class="long-description"><p>Returns 'Unknown' for unknown codes.
Returns array of all codes, if $code is not specified.</p>

<p>Conforms to HTTP/1.1 as defined in RFC 2616 (except for 'Unknown')
See http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10 for reference</p></div><strong>Parameters</strong><table class="argument-info"><thead><tr><th>Name</th><th>Type</th><th>Description</th></tr></thead><tr><th>$code</th><td>int</td><td><em><p>HTTP response code</p></em></td></tr><tr><th>$http11</th><td>boolean</td><td><em><p>Use HTTP version 1.1</p></em></td></tr></table><strong>Returns</strong><table class="argument-info"><thead><tr><th>Type</th><th>Description</th></tr></thead><tr><td>string</td><td></td></tr></table></div><div class="clear"></div></div></div></div></div><small class="footer">
            Documentation was generated by
            <a href="http://phpdoc.org">phpDocumentor
                2.0.0a12</a>.
        </small></body></html>