Request
class Request extends AbstractMessage implements RequestInterface
Class Request
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.
Merges cookie headers on the way out.
Returns a string representation of the current request.
Constructor.
Sets the HTTP method of the current request.
Returns the HTTP method of the current request.
Sets the resource for the current request.
Returns the resource portion of the request line.
Sets the host for the current request.
Returns the value of the host header.
No description
Returns the protocol version of the current request.
A convenience method for getting the full URL of the current request.
Returns true if the current request is secure.
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 33
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 42
addHeader(string $header)
Adds a header to this message.
in AbstractMessage at line 114
addHeaders(array $headers)
Adds a set of headers to this message.
Headers can be complete ["Header: value"] pairs or an associative array ["Header" => "value"]
at line 132
array
getHeaders()
Merges cookie headers on the way out.
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.
at line 142
string
__toString()
Returns a string representation of the current request.
in AbstractMessage at line 145
protected
flattenHeaders(array $headers)
at line 26
__construct(string $method = self::METHOD_GET, string $resource = '/', string $host = null)
Constructor.
at line 55
setMethod(string $method)
Sets the HTTP method of the current request.
at line 60
string
getMethod()
Returns the HTTP method of the current request.
at line 65
setResource(string $resource)
Sets the resource for the current request.
at line 70
string
getResource()
Returns the resource portion of the request line.
at line 75
setHost(string $host)
Sets the host for the current request.
at line 80
string|null
getHost()
Returns the value of the host header.
at line 85
setProtocolVersion($protocolVersion)
at line 90
float
getProtocolVersion()
Returns the protocol version of the current request.
at line 100
string
getUrl()
A convenience method for getting the full URL of the current request.
at line 110
fromUrl(Url|string $url)
A convenience method for populating the current request from a URL.
at line 124
Boolean
isSecure()
Returns true if the current request is secure.