WordPress\AiClient\Providers\Http\Collections

HeadersCollection::withHeaderpublicWP 0.1.0

Returns a new instance with the specified header.

Method of the class: HeadersCollection{}

No Hooks.

Returns

self. A new instance with the header.

Usage

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

Changelog

Since 0.1.0 Introduced.

HeadersCollection::withHeader() code WP 7.0

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