I would like to get the response headers of an url, example:
$client = new \GuzzleHttp\Client();
$response = $client->head('http://example.com/');
echo $response->getStatusCode();
I cannot use HEAD
requests because some web server doesn't recognize HEAD requests (sometime they return 403 forbidden or internal server error).
Is there any way to get headers with guzzle without doing HEAD?
Clarification
I want to get just the headers and not the full body response. Imagine i want to check the headers of a large file, if i use get, Guzzle will download all the file and I don't want that