古いバージョンの Guzzle でかなり長い間使用していた次のサービスの説明があります。
[
'name' => 'Gist',
'apiVersion' => 'v3',
'baseUrl' => 'https://api.github.com/',
'description' => 'Gists and comments access',
'operations' => [
'GetGists' => [
'httpMethod' => 'GET',
'uri' => '/users/{user}/gists',
'parameters' => [
'user' => [
'location' => 'uri',
'required' => true,
],
'since' => [
'location' => 'query',
],
],
],
'GetComments' => [
'httpMethod' => 'GET',
'uri' => '/gists/{id}/comments',
'parameters' => [
'id' => [
'location' => 'uri',
'required' => true,
],
],
],
],
]
今、私はたくさんのものをGuzzleの現在のバージョンに移していますが、これは新しいブレイクアウトで動作することを絶対に拒否していguzzle/services
ます.
私のコードは次の行に沿っています:
$client = new Client;
$client->setDefaultOption('verify', false);
$description = new Description($this->getServiceDescription());
$guzzleClient = new GuzzleClient($client, $description);
$command = $guzzleClient->getCommand('GetGists', [ 'user' => $this->user ]);
$gists = $guzzleClient->execute($command); // $gists is empty array?..
必要な引数やスペルミスのある名前を指定しないと文句を言うので、少なくとも部分的にコマンドを明確に理解しています。
しかし、最終的には空の配列であり、トラブルシューティングを行うために何をする必要があるか、またはサービスの説明をどのように更新する必要があるかはわかりません。
アクセスする必要がある (アクセスする?) URL はhttps://api.github.com/users/Rarst/gistsです。