HeadersCollection::get( string $name ): WordPressAiClientProvidersHttpCollectionslist<string>|null

In this article

Gets a specific header value.

Parameters

$namestringrequired
The header name (case-insensitive).

Return

WordPressAiClientProvidersHttpCollectionslist<string>|null The header value(s) or null if not found.

Source

public function get(string $name): ?array
{
    $lowerName = strtolower($name);
    if (!isset($this->headersMap[$lowerName])) {
        return null;
    }
    $actualName = $this->headersMap[$lowerName];
    return $this->headers[$actualName];
}

Changelog

VersionDescription
0.1.0Introduced.

User Contributed Notes

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