Moodle PHP Documentation 4.3
Moodle 4.3.5 (Build: 20240610) (7dcfaa79f78)
GuzzleHttp\Psr7\Message Class Reference

Static Public Member Functions

static bodySummary (MessageInterface $message, int $truncateAt=120)
 Get a short summary of the message body.
 
static parseMessage (string $message)
 Parses an HTTP message into an associative array.
 
static parseRequest (string $message)
 Parses a request message string into a request object.
 
static parseRequestUri (string $path, array $headers)
 Constructs a URI for an HTTP request message.
 
static parseResponse (string $message)
 Parses a response message string into a response object.
 
static rewindBody (MessageInterface $message)
 Attempts to rewind a message body and throws an exception on failure.
 
static toString (MessageInterface $message)
 

Member Function Documentation

◆ bodySummary()

static GuzzleHttp\Psr7\Message::bodySummary ( MessageInterface $message,
int $truncateAt = 120 )
static

Get a short summary of the message body.

Will return null if the response is not printable.

Parameters
MessageInterface$messageThe message to get the body summary
int$truncateAtThe maximum allowed size of the summary

◆ parseMessage()

static GuzzleHttp\Psr7\Message::parseMessage ( string $message)
static

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.

Parameters
string$messageHTTP request or response to parse.

◆ parseRequest()

static GuzzleHttp\Psr7\Message::parseRequest ( string $message)
static

Parses a request message string into a request object.

Parameters
string$messageRequest message string.

◆ parseRequestUri()

static GuzzleHttp\Psr7\Message::parseRequestUri ( string $path,
array $headers )
static

Constructs a URI for an HTTP request message.

Parameters
string$pathPath from the start-line
array$headersArray of headers (each value an array).

◆ parseResponse()

static GuzzleHttp\Psr7\Message::parseResponse ( string $message)
static

Parses a response message string into a response object.

Parameters
string$messageResponse message string.

◆ rewindBody()

static GuzzleHttp\Psr7\Message::rewindBody ( MessageInterface $message)
static

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.

Parameters
MessageInterface$messageMessage to rewind
Exceptions
RuntimeException

The documentation for this class was generated from the following file: