Magento 2 Documentation
2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
|
Public Member Functions | |
getStream () | |
setStream ($stream) | |
getCleanup () | |
setCleanup ($cleanup=true) | |
getStreamName () | |
setStreamName ($stream_name) | |
__construct ($code, $headers, $body=null, $version='1.1', $message=null) | |
getBody () | |
getRawBody () | |
__destruct () | |
![]() | |
__construct ($code, array $headers, $body=null, $version='1.1', $message=null) | |
isError () | |
isSuccessful () | |
isRedirect () | |
getBody () | |
getRawBody () | |
getVersion () | |
getStatus () | |
getMessage () | |
getHeaders () | |
getHeader ($header) | |
getHeadersAsString ($status_line=true, $br="\n") | |
asString ($br="\r\n") | |
__toString () | |
Static Public Member Functions | |
static | fromStream ($response_str, $stream) |
![]() | |
static | responseCodeAsText ($code=null, $http11=true) |
static | extractCode ($response_str) |
static | extractMessage ($response_str) |
static | extractVersion ($response_str) |
static | extractHeaders ($response_str) |
static | extractBody ($response_str) |
static | decodeChunkedBody ($body) |
static | decodeGzip ($body) |
static | decodeDeflate ($body) |
static | fromString ($response_str) |
Protected Member Functions | |
readStream () | |
Protected Attributes | |
$stream | |
$stream_name | |
$_cleanup | |
![]() | |
$version | |
$code | |
$message | |
$headers = array() | |
$body | |
Additional Inherited Members | |
![]() | |
static | $messages |
Definition at line 34 of file Stream.php.
__construct | ( | $code, | |
$headers, | |||
$body = null , |
|||
$version = '1.1' , |
|||
$message = null |
|||
) |
HTTP response constructor
In most cases, you would use Zend_Http_Response::fromString to parse an HTTP response string and create a new Zend_Http_Response object.
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.
If no message is passed, the message will be guessed according to the response code.
int | $code | Response code (200, 404, ...) |
array | $headers | Headers array |
string | $body | Response body |
string | $version | HTTP version |
string | $message | Response code as text |
Zend_Http_Exception |
Definition at line 139 of file Stream.php.
__destruct | ( | ) |
Definition at line 224 of file Stream.php.
|
static |
Create a new Zend_Http_Response_Stream object from a string
string | $response_str | |
resource | $stream |
Definition at line 156 of file Stream.php.
getBody | ( | ) |
Get the response body as string
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.
If you want to get the raw body (as transfered on wire) use $this->getRawBody() instead.
Definition at line 178 of file Stream.php.
getCleanup | ( | ) |
getRawBody | ( | ) |
Get the raw response body (as transfered "on wire") as string
If the body is encoded (with Transfer-Encoding, not content-encoding - IE "chunked" body), gzip compressed, etc. it will not be decoded.
Definition at line 194 of file Stream.php.
getStream | ( | ) |
getStreamName | ( | ) |
|
protected |
Read stream content and return it as string
Function reads the remainder of the body from the stream and closes the stream.
Definition at line 209 of file Stream.php.
setCleanup | ( | $cleanup = true | ) |
Set the cleanup trigger
bool | $cleanup | Set cleanup trigger |
Definition at line 95 of file Stream.php.
setStream | ( | $stream | ) |
Set the response stream
resourse | $stream |
Definition at line 75 of file Stream.php.
setStreamName | ( | $stream_name | ) |
Set file name associated with the stream
string | $stream_name | Name to set |
Definition at line 114 of file Stream.php.
|
protected |
Definition at line 57 of file Stream.php.
|
protected |
Definition at line 41 of file Stream.php.
|
protected |
Definition at line 50 of file Stream.php.