CR
CR = "\r"
Serialize (cast to string) or deserialize (cast string to Request) messages.
This class provides functionality for serializing a RequestInterface instance to a string, as well as the reverse operation of creating a Request instance from a string/stream representing a message.
fromString(string $message) : \Zend\Diactoros\Request
Deserialize a request string to a request instance.
Internally, casts the message to a stream and invokes fromStream().
string | $message |
when errors occur parsing the message.
fromStream(\Psr\Http\Message\StreamInterface $stream) : \Zend\Diactoros\Request
Deserialize a request stream to a request instance.
\Psr\Http\Message\StreamInterface | $stream |
when errors occur parsing the message.
toString(\Psr\Http\Message\RequestInterface $request) : string
Serialize a request message to a string.
\Psr\Http\Message\RequestInterface | $request |
getLine(\Psr\Http\Message\StreamInterface $stream) : string
Retrieve a single line from the stream.
Retrieves a line from the stream; a line is defined as a sequence of characters ending in a CRLF sequence.
\Psr\Http\Message\StreamInterface | $stream |
if the sequence contains a CR or LF in isolation, or ends in a CR.
splitStream(\Psr\Http\Message\StreamInterface $stream) : array
Split the stream into headers and body content.
Returns an array containing two elements
\Psr\Http\Message\StreamInterface | $stream |
For invalid headers.
getRequestLine(\Psr\Http\Message\StreamInterface $stream) : array
Retrieve the components of the request line.
Retrieves the first line of the stream and parses it, raising an exception if it does not follow specifications; if valid, returns a list with the method, target, and version, in that order.
\Psr\Http\Message\StreamInterface | $stream |
createUriFromRequestTarget(string $requestTarget) : \Zend\Diactoros\Uri
Create and return a Uri instance based on the provided request target.
If the request target is of authority or asterisk form, an empty Uri instance is returned; otherwise, the value is used to create and return a new Uri instance.
string | $requestTarget |
Loading…