Fully Qualified Name: | Laminas\Http\PhpEnvironment\Response |
Extends: | Response |
HTTP Response for current PHP environment
Name | Description | Defined By |
---|---|---|
__toString() | Allow PHP casting of this object | AbstractMessage |
contentSent() | Response | |
fromString() | Populate object from string | Response |
getBody() | Get the body of the response | Response |
getContent() | Get message content | Message |
getCookie() | Response | |
getHeaders() | Return the header container responsible for headers | AbstractMessage |
getMetadata() | Retrieve all metadata or a single metadatum as specified by key | Message |
getReasonPhrase() | Get HTTP status message | Response |
getStatusCode() | Retrieve HTTP status code | Response |
getVersion() | Return the HTTP version for this response | Response |
headersSent() | Response | |
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 |
send() | Send HTTP response | Response |
sendContent() | Send content | Response |
sendHeaders() | Send HTTP headers | Response |
setContent() | Set message content | Message |
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 |
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 |
Allow PHP casting of this object
Returns: string
Returns: bool
Populate object from string
Parameter Name | Type | Description |
---|---|---|
$string | string |
Returns: static
Get the body of the response
Returns: string
Get message content
Returns: mixed
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 HTTP status message
Returns: string
Retrieve HTTP status code
Returns: int
Return the HTTP version for this response
Returns: string
Returns: bool
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
Send HTTP response
Returns: $this
Send content
Returns: $this
Send HTTP headers
Returns: $this
Set message content
Parameter Name | Type | Description |
---|---|---|
$value | mixed |
Returns: \Message
Set custom HTTP status code
Parameter Name | Type | Description |
---|---|---|
$code | int |
Returns: $this
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: $this
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: $this
Set HTTP status code and (optionally) message
Parameter Name | Type | Description |
---|---|---|
$code | int |
Returns: $this
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: $this
Render entire response as HTTP response string
Returns: string