diff --git a/src/OAuth1/Server.php b/src/OAuth1/Server.php index a91b4d9..0d98214 100644 --- a/src/OAuth1/Server.php +++ b/src/OAuth1/Server.php @@ -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); }