Response
class Response extends AbstractMessage
Class Response
Methods
Returns the value of a header.
Returns the value of a particular header attribute.
Sets all headers on the current message.
Adds a header to this message.
Adds a set of headers to this message.
Returns the protocol version of the current response.
Returns the status code of the current response.
Returns the reason phrase for the current response.
Is response invalid?
Is response informative?
Is response successful?
Is the response a redirect?
Is there a client error?
Was there a server side error?
Is the response OK?
Is the reponse forbidden?
Is the response a not found error?
Is the response empty?
Details
in AbstractMessage at line 22
string|array|null
getHeader(string $name, string|boolean $glue = "\r\n")
Returns the value of a header.
in AbstractMessage at line 47
array
getHeaderAttributes(string $name)
Returns a header's attributes.
in AbstractMessage at line 74
string|null
getHeaderAttribute(string $header, string $attribute)
Returns the value of a particular header attribute.
in AbstractMessage at line 88
DOMDocument
toDomDocument()
Returns the current message as a DOMDocument.
at line 57
setHeaders(array $headers)
Sets all headers on the current message.
Headers can be complete ["Header: value"] pairs or an associative array ["Header" => "value"]
at line 64
addHeader(string $header)
Adds a header to this message.
at line 71
addHeaders(array $headers)
Adds a set of headers to this message.
Headers can be complete ["Header: value"] pairs or an associative array ["Header" => "value"]
in AbstractMessage at line 119
array
getHeaders()
Returns an array of header lines.
in AbstractMessage at line 124
setContent(string $content)
Sets the content of the message.
in AbstractMessage at line 129
string
getContent()
Returns the content of the message.
in AbstractMessage at line 134
string
__toString()
Returns the message document.
in AbstractMessage at line 145
protected
flattenHeaders(array $headers)
at line 20
float
getProtocolVersion()
Returns the protocol version of the current response.
at line 34
integer
getStatusCode()
Returns the status code of the current response.
at line 48
string
getReasonPhrase()
Returns the reason phrase for the current response.
at line 83
Boolean
isInvalid()
Is response invalid?
at line 93
Boolean
isInformational()
Is response informative?
at line 103
Boolean
isSuccessful()
Is response successful?
at line 113
Boolean
isRedirection()
Is the response a redirect?
at line 123
Boolean
isClientError()
Is there a client error?
at line 133
Boolean
isServerError()
Was there a server side error?
at line 143
Boolean
isOk()
Is the response OK?
at line 153
Boolean
isForbidden()
Is the reponse forbidden?
at line 163
Boolean
isNotFound()
Is the response a not found error?
at line 173
Boolean
isEmpty()
Is the response empty?