Skip to content

Commit d7d250a

Browse files
authored
Merge pull request #14 from ABGEO/bugfix/fix-request-type
♻️ Use http_build_query() for building Auth Request body.
2 parents 56549a8 + f875382 commit d7d250a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Context/JsonApiContext.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,8 @@ protected function sendOauthRequest(array $payload)
742742
{
743743
$url = sprintf('%s%s', $this->baseUrl, $this->parameters['oauth']['uri']);
744744

745-
$response = $this->client->post($url, $this->headers, json_encode($payload));
745+
$this->headers['Content-Type'] = 'application/x-www-form-urlencoded';
746+
$response = $this->client->post($url, $this->headers, http_build_query($payload));
746747
$responseContent = json_decode($response->getContent());
747748

748749
// Throw an exception if the statuscode is not 200

0 commit comments

Comments
 (0)