\Zend_Http_Response_Stream
Zend_Http_Response represents an HTTP 1.0 / 1.1 response message. It includes easy access to all the response's different elemts, as well as some convenience methods for parsing and validating HTTP responses.
- Copyright: Copyright (c) 2005-2011 Zend Technologies USA Inc. (http://www.zend.com)
- License: http://framework.zend.com/license/new-bsd New BSD License
Synopsis
class Zend_Http_Response_Stream
extends Zend_Http_Response
{
- // members
- protected $stream;
- protected $stream_name;
- protected $_cleanup;
- // Inherited members from Zend_Http_Response
- protected static array $messages;
- protected $version;
- protected $code;
- protected $message;
- protected array $headers;
- protected $body;
- // methods
- public resourse getStream()
- public Zend_Http_Response_Stream setStream()
- public boolean getCleanup()
- public void setCleanup()
- public string getStreamName()
- public Zend_Http_Response_Stream setStreamName()
- public void __construct()
- public static Zend_Http_Response_Stream fromStream()
- public string getBody()
- public string getRawBody()
- protected string readStream()
- public void __destruct()
- // Inherited methods from Zend_Http_Response
- public void __construct()
- public boolean isError()
- public boolean isSuccessful()
- public boolean isRedirect()
- public string getBody()
- public string getRawBody()
- public string getVersion()
- public int getStatus()
- public string getMessage()
- public array getHeaders()
- public string|array|null getHeader()
- public string getHeadersAsString()
- public string asString()
- public string __toString()
- public static string responseCodeAsText()
- public static int extractCode()
- public static string extractMessage()
- public static string extractVersion()
- public static array extractHeaders()
- public static string extractBody()
- public static string decodeChunkedBody()
- public static string decodeGzip()
- public static string decodeDeflate()
- public static Zend_Http_Response fromString()
Hierarchy
Extends
Members
protected
- $_cleanup
—
boolean
Should we clean up the stream file when this response is closed? - $body
—
string
The HTTP response body - $code
—
int
The HTTP response code - $headers
—
array
The HTTP response headers array - $message
—
string
The HTTP response code as string (e.g. 'Not Found' for 404 or 'Internal Server Error' for 500) - $messages
—
array
List of all known HTTP response codes - used by responseCodeAsText() to translate numeric codes to messages. - $stream
—
resource
Response as stream - $stream_name
—
string
The name of the file containing the stream - $version
—
string
The HTTP version (1.0, 1.1)
Methods
protected
- readStream() — Read stream content and return it as string
public
- __construct() — HTTP response constructor
- __destruct()
- fromStream() — Create a new Zend_Http_Response_Stream object from a string
- getBody() — Get the response body as string
- getCleanup() — Get the cleanup trigger
- getRawBody() — Get the raw response body (as transfered "on wire") as string
- getStream() — Get the response as stream
- getStreamName() — Get file name associated with the stream
- setCleanup() — Set the cleanup trigger
- setStream() — Set the response stream
- setStreamName() — Set file name associated with the stream
Inherited from Zend_Http_Response
public
- __toString() — Implements magic __toString()
- asString() — Get the entire response as string
- decodeChunkedBody() — Decode a "chunked" transfer-encoded body and return the decoded text
- decodeDeflate() — Decode a zlib deflated message (when Content-encoding = deflate)
- decodeGzip() — Decode a gzip encoded message (when Content-encoding = gzip)
- extractBody() — Extract the body from a response string
- extractCode() — Extract the response code from a response string
- extractHeaders() — Extract the headers from a response string
- extractMessage() — Extract the HTTP message from a response
- extractVersion() — Extract the HTTP version from a response
- fromString() — Create a new Zend_Http_Response object from a string
- getBody() — Get the response body as string
- getHeader() — Get a specific header as string, or null if it is not set
- getHeaders() — Get the response headers
- getHeadersAsString() — Get all headers as string
- getMessage() — Return a message describing the HTTP response code (Eg. "OK", "Not Found", "Moved Permanently")
- getRawBody() — Get the raw response body (as transfered "on wire") as string
- getStatus() — Get the HTTP response status code
- getVersion() — Get the HTTP version of the response
- isError() — Check whether the response is an error
- isRedirect() — Check whether the response is a redirection
- isSuccessful() — Check whether the response in successful
- responseCodeAsText() — A convenience function that returns a text representation of HTTP response codes. Returns 'Unknown' for unknown codes.