I'm trying to update my library to use `Guzzle4`. I load my client configuration with `\Guzzle\Description` as shown in the doc. The file is
https://github.com/hpatoio/bitly-api/blob/master/src/Resources/bitly.json
As you can see there is an `access_token` parameter to all requests. In
the `Guzzle3` version of my library `access_token` is added by a plugin
https://github.com/hpatoio/bitly-api/blob/master/src/Plugin/TokenAuthPlugin.php
I'm now trying to replicate this behaviour with Guzzle4. I've create an
`AccessTokenSubscriber` that listen for event `prepare` on '\Command\Guzzle\GuzzleClient' and add
`access_token` parameter to the request. Here you can see a draft
https://gist.github.com/hpatoio/d5d0c2a772b3fb5f8a80I couldn't find a way to add the parameter "access_token" so I had to add a "addParam" method to "GuzzleHttp\Command" class. The method is dead simple:
public function addParam($name, $value)
{
$this->data[$name] = $value;
}
In this way the parameter is set in the request. Am I missing something or there is now other way to achive this ?
Thanks
--
Simone