在使用 Symfony2 OrkestraGuzzleBundle时,我无法使其正确使用路径参数。
这是我的命令功能:
/**
* @Command(name="nitex_authenticate", method="GET", uri="/oauth/v2/token?client_id={client_id}&client_secret={client_secret}&grant_type=client_credentials")
* @Doc("Get Access Token")
* @Param(name="client_id", type="string", required="true")
* @Param(name="client_secret", type="string", required="true")
*/
public function getNitexAccessTokenCommand()
{
return $this->getResponse();
}
当我执行命令时,我收到“错误请求”错误消息,其中 URL 显示为 [url]http://niksites.localapps.com/oauth/v2/token?client_id=&client_secret=&grant_type=client_credentials
$authParams = array (
'client_id' => '1_3rshkkbo2c00c8ws0sswwow4co8ckkgog0oocows0coswwc44w',
'client_secret' => '45j81mlc70iswgg0sgscgg04s4soc8wow8wos8sww0ccwggoks'
);
$response = $this->guzzle
->getService('nitex.auth')
->execute('nitex_authenticate', $authParams);
我究竟做错了什么?根据文档似乎很简单,但是由于某种原因它对我不起作用。