phasync
CurlResponse / getHeaderLine

Method

CurlResponse::getHeaderLine

Return the values of a header joined by ", ", or an empty string; the name is case-insensitive.

Description#

public CurlResponse::getHeaderLine(
    string $name
): string

Waits for the headers. With redirects followed, these are the headers of the last response.

Parameters#

$name string

Return values#

string

Examples#

Example 1
echo $client->get('https://example.com/')->getHeaderLine('content-type');

See also#