Skip to content

Kirby 3.9.8

$remote->headers()

Returns all received headers

$remote->headers(): array

Return type

array

Parent class

Kirby\Http\Remote

Example

<?php
$response = Remote::get('http://placekitten.com/200/300');

dump($response->headers());

/** Example dump result
^ array:16 [▼
"Date" => "Sun, 16 Apr 2023 14:30:18 GMT"
"Content-Length" => "9339"
"Connection" => "keep-alive"
"Cache-Control" => "public, max-age=86400"
"Expires" => "Thu, 31 Dec 2020 20:00:00 GMT"
"Vary" => "User-Agent, Accept-Encoding"
"Access-Control-Allow-Origin" => "*"
"Last-Modified" => "Sat, 15 Apr 2023 06:23:28 GMT"
"CF-Cache-Status" => "HIT"
"Age" => "33423"
"Accept-Ranges" => "bytes"
"Report-To" => "{"endpoints":[{"url":"https:\/\/a.nel.cloudflare.com\/report\/v3?s=4vZQgs2oxA3eVVzIxTcmlUEIx7YIzwpzV1cfKjATuOXeGaE3Qn%2B1xz4sacdDLaGMzdz3lI46%2Be2FthD%2F%2B4Cww ▶"
"NEL" => "{"success_fraction":0,"report_to":"cf-nel","max_age":604800}"
"Server" => "cloudflare"
"CF-RAY" => "7b8d201da8023663-FRA"
"alt-svc" => "h3=":443"; ma=86400, h3-29=":443"; ma=86400"
]
*/