Skip to content

Commit

Permalink
Merge pull request #8 from dsingh-dev/dharmendra/labelcamp
Browse files Browse the repository at this point in the history
Content-Type Fixed For Token
  • Loading branch information
bhanwarpsrathore authored Feb 15, 2024
2 parents 7f54ecc + cb7bf92 commit 62c38c3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,10 @@ public function send(string $method, string $url, array $options): array {
$parsedBody = json_decode($body->getContents(), true);
}

if (in_array('application/json; charset=utf-8', $response->getHeader('Content-Type'))) {
$parsedBody = json_decode($body->getContents(), true);
}

$this->lastResponse = [
'body' => $parsedBody,
'headers' => $parsedHeaders,
Expand Down

0 comments on commit 62c38c3

Please sign in to comment.