Provides base functionality for request and response de/serialization strategies, including functionality for retrieving a line at a time from the message, splitting headers from the body, and serializing headers.
More...
|
const | CR = "\r" |
|
const | EOL = "\r\n" |
|
const | LF = "\n" |
|
|
static | getLine (StreamInterface $stream) |
| Retrieve a single line from the stream.
|
|
static | splitStream (StreamInterface $stream) |
| Split the stream into headers and body content.
|
|
static | serializeHeaders (array $headers) |
| Serialize headers to string values.
|
|
static | filterHeader ($header) |
| Filter a header name to wordcase.
|
|
Provides base functionality for request and response de/serialization strategies, including functionality for retrieving a line at a time from the message, splitting headers from the body, and serializing headers.
static filterHeader |
( |
|
$header | ) |
|
|
staticprotected |
Filter a header name to wordcase.
- Parameters
-
- Returns
- string
static getLine |
( |
StreamInterface |
$stream | ) |
|
|
staticprotected |
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.
- Parameters
-
- Returns
- string
- Exceptions
-
UnexpectedValueException | if the sequence contains a CR or LF in isolation, or ends in a CR. |
static serializeHeaders |
( |
array |
$headers | ) |
|
|
staticprotected |
Serialize headers to string values.
- Parameters
-
- Returns
- string
static splitStream |
( |
StreamInterface |
$stream | ) |
|
|
staticprotected |
Split the stream into headers and body content.
Returns an array containing two elements
- The first is an array of headers
- The second is a StreamInterface containing the body content
- Parameters
-
- Returns
- array
- Exceptions
-
UnexpectedValueException | For invalid headers. |