I'm currently working with Drupal 8's Guzzle HTTP Client.
What I need is the request headers, response headers and the response data (raw html).
Response headers and response data is not the problem:
$client = \Drupal::httpClient(); $response = $client->get('https://www.drupal.org'); $responseHeaders = $response->getHeaders(); //Response Headers array $body = $response->getBody()->getContents(); // Raw HTML
But what's the way to get the request headers?
I can find a way in documentation of GuzzleHttp version 4 (https://guzzle.readthedocs.org/en/guzzle4/http-messages.html) but nothing like this in version 6 (which is being used by Drupal 8).