HeadersCollection::withHeader( string $name, string|WordPressAiClientProvidersHttpCollectionslist $value ): self

In this article

Returns a new instance with the specified header.

Parameters

$namestringrequired
The header name.
$valuestring|<span class="WordPressAiClientProvidersHttpCollectionslist”>WordPressAiClientProvidersHttpCollectionslistrequired
The header value(s).

Return

self A new instance with the header.

Source

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

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.