Copied!
CloneableFinalInstantiable
Methods
public static bodySummary(Psr\Http\Message\MessageInterface $message, int $truncateAt = 120) : ?string
 

Get a short summary of the message body.

Will return null if the response is not printable.

  • param \MessageInterface $message The message to get the body summary
  • param int $truncateAt The maximum allowed size of the summary
public static 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.

  • param string $message HTTP request or response to parse.
public static parseRequest(string $message) : Psr\Http\Message\RequestInterface
 

Parses a request message string into a request object.

  • param string $message Request message string.
public static parseRequestUri(string $path, array $headers) : string
 

Constructs a URI for an HTTP request message.

  • param string $path Path from the start-line
  • param array $headers Array of headers (each value an array).
public static parseResponse(string $message) : Psr\Http\Message\ResponseInterface
 

Parses a response message string into a response object.

  • param string $message Response message string.
public static rewindBody(Psr\Http\Message\MessageInterface $message) : void
 

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.

  • param \MessageInterface $message Message to rewind
  • throws \RuntimeException
public static toString(Psr\Http\Message\MessageInterface $message) : string
 

Returns the string representation of an HTTP message.

  • param \MessageInterface $message Message to convert to a string.
Methods
public static bodySummary(Psr\Http\Message\MessageInterface $message, int $truncateAt = 120) : ?string
 

Get a short summary of the message body.

Will return null if the response is not printable.

  • param \MessageInterface $message The message to get the body summary
  • param int $truncateAt The maximum allowed size of the summary
public static 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.

  • param string $message HTTP request or response to parse.
public static parseRequest(string $message) : Psr\Http\Message\RequestInterface
 

Parses a request message string into a request object.

  • param string $message Request message string.
public static parseRequestUri(string $path, array $headers) : string
 

Constructs a URI for an HTTP request message.

  • param string $path Path from the start-line
  • param array $headers Array of headers (each value an array).
public static parseResponse(string $message) : Psr\Http\Message\ResponseInterface
 

Parses a response message string into a response object.

  • param string $message Response message string.
public static rewindBody(Psr\Http\Message\MessageInterface $message) : void
 

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.

  • param \MessageInterface $message Message to rewind
  • throws \RuntimeException
public static toString(Psr\Http\Message\MessageInterface $message) : string
 

Returns the string representation of an HTTP message.

  • param \MessageInterface $message Message to convert to a string.
© 2025 Bruce Wells
Search Namespaces \ Classes
Configuration