Skip to content

Commit

Permalink
Merge pull request #68 from litvinchuk/patch-1
Browse files Browse the repository at this point in the history
Make possible to use OAuth1 with Guzzle 6
  • Loading branch information
faustbrian authored Nov 1, 2016
2 parents 63932b2 + 6742f45 commit 904283b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/OAuth1/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,14 @@ public function getTokenCredentials(TemporaryCredentials $temporaryCredentials,
$headers = $this->getHeaders($temporaryCredentials, 'POST', $uri, $bodyParameters);

try {
$response = $client->post($uri, $headers, $bodyParameters)->send();
if (get_class($client) == 'GuzzleHttp\\Client') {
$response = $client->post($uri, [
'headers' => $headers,
'form_params' => $bodyParameters,
]);
} else {
$response = $client->post($uri, $headers, $bodyParameters)->send();
}
} catch (BadResponseException $e) {
return $this->handleTokenCredentialsBadResponse($e);
}
Expand Down

0 comments on commit 904283b

Please sign in to comment.