WordPress\AiClient\Providers\Http\Collections

HeadersCollection::getpublicWP 0.1.0

Gets a specific header value.

Method of the class: HeadersCollection{}

No Hooks.

Returns

list|null. The header value(s) or null if not found.

Usage

$HeadersCollection = new HeadersCollection();
$HeadersCollection->get( $name ): ?array;
$name(string) (required)
The header name (case-insensitive).

Changelog

Since 0.1.0 Introduced.

HeadersCollection::get() code WP 7.0

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