Returns a new instance with the specified header.
Parameters
$namestringrequired- The header name.
$valuestring|<span class="WordPressAiClientProvidersHttpDTOlist”>WordPressAiClientProvidersHttpDTOlistrequired- The header value(s).
Source
public function withHeader(string $name, $value): self
{
$newHeaders = $this->headers->withHeader($name, $value);
$new = clone $this;
$new->headers = $newHeaders;
return $new;
}
Changelog
| Version | Description |
|---|---|
| 0.1.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.