toString()
toString(\Psr\Http\Message\MessageInterface $message) : string
Returns the string representation of an HTTP message.
Parameters
\Psr\Http\Message\MessageInterface | $message | Message to convert to a string. |
bodySummary(\Psr\Http\Message\MessageInterface $message, int $truncateAt = 120) : string|null
Get a short summary of the message body.
Will return null
if the response is not printable.
\Psr\Http\Message\MessageInterface | $message | The message to get the body summary |
int | $truncateAt | The maximum allowed size of the summary |
rewindBody(\Psr\Http\Message\MessageInterface $message) : mixed
Attempts to rewind a message body and throws an exception on failure.
The body of the message will only be rewound if a call to tell()
returns a value other than 0
.
\Psr\Http\Message\MessageInterface | $message | Message to rewind |
parseMessage(string $message) : array
Parses an HTTP message into an associative array.
The array contains the "start-line" key containing the start line of the message, "headers" key containing an associative array of header array values, and a "body" key containing the body of the message.
string | $message | HTTP request or response to parse. |