wppaste
WordPress

Request

Source
wp-includes/php-ai-client/third-party/Nyholm/Psr7/Request.php:15

Compatibility

WordPress
core
  • 6.7.7
  • 6.8.8
  • 6.9.7
  • 7.0.4
  • 7.1.0

Present in 2 of the 5 tracked releases.

Methods · 1

Source code

class Request implements RequestInterface{    use MessageTrait;    use RequestTrait;    /**     * @param string $method HTTP method     * @param string|UriInterface $uri URI     * @param array $headers Request headers     * @param string|resource|StreamInterface|null $body Request body     * @param string $version Protocol version     */    public function __construct(string $method, $uri, array $headers = [], $body = null, string $version = '1.1')    {        if (!$uri instanceof UriInterface) {            $uri = new Uri($uri);        }        $this->method = $method;        $this->uri = $uri;        $this->setHeaders($headers);        $this->protocol = $version;        if (!$this->hasHeader('Host')) {            $this->updateHostFromUri();        }        // If we got no body, defer initialization of the stream until Request::getBody()        if ('' !== $body && null !== $body) {            $this->stream = Stream::create($body);        }    }}

Changelog

Unchanged from 7.0.4 through 7.1.0.

  1. 7.0.4
  2. 7.1.0

Signature, return type and hooks compared across 2 parsed releases.

About this page

Parsed data
Generated from the wordpress-develop 7.1.0 tag, from src/wp-includes/php-ai-client/third-party/Nyholm/Psr7/Request.php, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
Corrections
Something wrong on this page? Report it and it gets fixed in the next regeneration.