$baseUrl = 'http://foo';
$config = array();
$client = new Guzzle\Http\Client($baseUrl, $config);
What's the new way to set the default header for Guzzle without passing it as a parameter on every $client->post($uri, $headers)
?
There's $client->setDefaultHeaders($headers)
but it's deprecated.
setDefaultHeaders is deprecated. Use the request.options array to specify default request options
If you are using Guzzle v=6.0.*
$client = new GuzzleHttp\Client(['headers' => ['X-Foo' => 'Bar']]);
read the doc, there are more options.