Request::withHeader( string $name, string|WordPressAiClientProvidersHttpDTOlist $value ): self

In this article

Returns a new instance with the specified header.

Parameters

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

Return

self A new instance with the header.

Source

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

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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