Fully Qualified Name: | Zend\Http\Response\Stream |
Extends: | Response |
Represents an HTTP response message as PHP stream resource
Name | Description | Defined By |
---|---|---|
__destruct() | Destructor | Stream |
__toString() | Allow PHP casting of this object | AbstractMessage |
fromStream() | Create a new Zend\Http\Response\Stream object from a stream | Stream |
fromString() | Populate object from string | Response |
getBody() | Get the response body as string | Stream |
getCleanup() | Get the cleanup trigger | Stream |
getContent() | Get message content | Message |
getContentLength() | Get content length | Stream |
getCookie() | Response | |
getHeaders() | Return the header container responsible for headers | AbstractMessage |
getMetadata() | Retrieve all metadata or a single metadatum as specified by key | Message |
getRawBody() | Get the raw response body (as transferred "on wire") as string | Stream |
getReasonPhrase() | Get HTTP status message | Response |
getStatusCode() | Retrieve HTTP status code | Response |
getStream() | Get the response as stream | Stream |
getStreamName() | Get file name associated with the stream | Stream |
getVersion() | Return the HTTP version for this request | AbstractMessage |
isClientError() | Does the status code indicate a client error? | Response |
isForbidden() | Is the request forbidden due to ACLs? | Response |
isGone() | Does the status code indicate the resource is gone? | Response |
isInformational() | Is the current status "informational"? | Response |
isNotFound() | Does the status code indicate the resource is not found? | Response |
isOk() | Do we have a normal, OK response? | Response |
isRedirect() | Do we have a redirect? | Response |
isServerError() | Does the status code reflect a server error? | Response |
isSuccess() | Was the response successful? | Response |
renderStatusLine() | Render the status line header | Response |
setCleanup() | Set the cleanup trigger | Stream |
setContent() | Set message content | Message |
setContentLength() | Set content length | Stream |
setCustomStatusCode() | Set custom HTTP status code | Response |
setHeaders() | Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders()) | AbstractMessage |
setMetadata() | Set message metadata | Message |
setReasonPhrase() | Response | |
setStatusCode() | Set HTTP status code and (optionally) message | Response |
setStream() | Set the response stream | Stream |
setStreamName() | Set file name associated with the stream | Stream |
setVersion() | Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2) | AbstractMessage |
toString() | Render entire response as HTTP response string | Response |
Destructor
Returns:
Allow PHP casting of this object
Returns: string
Create a new Zend\Http\Response\Stream object from a stream
Parameter Name | Type | Description |
---|---|---|
$responseString | string | |
$stream | resource |
Returns: \Stream
Populate object from string
Parameter Name | Type | Description |
---|---|---|
$string | string |
Returns: self
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 transferred on wire) use $this->getRawBody() instead.
Returns: string
Get the cleanup trigger
Returns: bool
Get message content
Returns: mixed
Get content length
Returns: int|null
Returns: \Header\SetCookie[]
Return the header container responsible for headers
Returns: \Headers
Retrieve all metadata or a single metadatum as specified by key
Parameter Name | Type | Description |
---|---|---|
$key | null|string|int | |
$default | null|mixed |
Returns: mixed
Get the raw response body (as transferred "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.
Returns: string
Get HTTP status message
Returns: string
Retrieve HTTP status code
Returns: int
Get the response as stream
Returns: resource
Get file name associated with the stream
Returns: string
Return the HTTP version for this request
Returns: string
Does the status code indicate a client error?
Returns: bool
Is the request forbidden due to ACLs?
Returns: bool
Does the status code indicate the resource is gone?
Returns: bool
Is the current status "informational"?
Returns: bool
Does the status code indicate the resource is not found?
Returns: bool
Do we have a normal, OK response?
Returns: bool
Do we have a redirect?
Returns: bool
Does the status code reflect a server error?
Returns: bool
Was the response successful?
Returns: bool
Render the status line header
Returns: string
Set the cleanup trigger
Parameter Name | Type | Description |
---|---|---|
$cleanup | bool |
Returns:
Set message content
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: \Message
Set content length
Parameter Name | Type | Description |
---|---|---|
$contentLength | int |
Returns:
Set custom HTTP status code
Parameter Name | Type | Description |
---|---|---|
$code | int |
Returns: self
Provide an alternate Parameter Container implementation for headers in this object, (this is NOT the primary API for value setting, for that see getHeaders())
Parameter Name | Type | Description |
---|---|---|
$headers | \Headers |
Returns: \AbstractMessage
Set message metadata
Non-destructive setting of message metadata; always adds to the metadata, never overwrites the entire metadata container.
Parameter Name | Type | Description |
---|---|---|
$spec | string|int|array|\Traversable | |
$value | mixed |
Returns: \Message
Parameter Name | Type | Description |
---|---|---|
$reasonPhrase | string |
Returns: self
Set HTTP status code and (optionally) message
Parameter Name | Type | Description |
---|---|---|
$code | int |
Returns: self
Set the response stream
Parameter Name | Type | Description |
---|---|---|
$stream | resource |
Returns: \Stream
Set file name associated with the stream
Parameter Name | Type | Description |
---|---|---|
$streamName | string | Name |
Returns: \Stream
Set the HTTP version for this object, one of 1.0, 1.1 or 2 (AbstractMessage::VERSION_10, AbstractMessage::VERSION_11, AbstractMessage::VERSION_2)
Parameter Name | Type | Description |
---|---|---|
$version | string | (Must |
Returns: \AbstractMessage
Render entire response as HTTP response string
Returns: string