Closed Coffee2CodeNL closed 7 years ago
I tested this issue with the current v5.2.1 (https://github.com/8p/GuzzleBundle/releases/tag/v5.2.1) without any problems. So this seems to be fixed.
I used following code: config.yml:
guzzle:
clients:
httpbin:
base_url: "https://httpbin.org"
headers:
Accept: 'application/json'
Controller:
$client = $this->get('guzzle.client.httpbin');
$response = $client->get('/get'); // using headers by config
$body = $response->getBody()->getContents();
// => request header: Accept: 'application/json'
$options = [
"headers" => [
"Accept" => "text/html"
],
];
$response = $client->get('/ip', $options);
// => request header: Accept: 'text/html'
I've set the header in config.yml as following, using anonymous OAuth authentication
Later, when a user is authenticated, i replace the header in the code:
And when i check on the logs, i find this:
As you can see, the Authorization header is not being replaced :(
What's going wrong here?