WordPress\AiClient\Providers\Http\DTO

Request::withHeaderpublicWP 0.1.0

Returns a new instance with the specified header.

Method of the class: Request{}

No Hooks.

Returns

self. A new instance with the header.

Usage

$Request = new Request();
$Request->withHeader( $name, $value ): self;
$name(string) (required)
The header name.
$value(string|list) (required)
The header value(s).

Changelog

Since 0.1.0 Introduced.

Request::withHeader() code WP 7.0.4

public function withHeader(string $name, $value): self
{
    $newHeaders = $this->headers->withHeader($name, $value);
    $new = clone $this;
    $new->headers = $newHeaders;
    return $new;
}