diff --git a/src/Pinterest/Http/Response.php b/src/Pinterest/Http/Response.php index e4bfc2c..2ef630c 100644 --- a/src/Pinterest/Http/Response.php +++ b/src/Pinterest/Http/Response.php @@ -80,7 +80,7 @@ public function __construct(Request $request, $statusCode, $rawBody, array $head $this->request = $request; $this->statusCode = (int) $statusCode; $this->rawBody = (string) $rawBody; - $this->body = $this->parseJson($this->rawBody); + $this->body = $this->statusCode >= 200 && $this->statusCode < 300 ? $this->parseJson($this->rawBody) : null; $this->headers = $headers; }