diff --git a/lib/ApiClient/Http/Response.php b/lib/ApiClient/Http/Response.php index fafe220..1a811c9 100644 --- a/lib/ApiClient/Http/Response.php +++ b/lib/ApiClient/Http/Response.php @@ -22,10 +22,10 @@ public function getStatusCode(): int public function getContent(): array { - if (!$this->content) { - return []; - } - + if (!$this->content) { + return []; + } + return json_decode($this->content, true, 512, JSON_THROW_ON_ERROR); } @@ -82,7 +82,7 @@ private function getLastElementOfLocationHeader(): ?string private function getLocationHeaderContent(): ?string { - foreach($this->getHeaders() as $key => $content) { + foreach ($this->getHeaders() as $key => $content) { if (strtolower($key) === 'location') { return trim($content[0]); }