getBody()->getContents(); $result = json_decode($contents, true); if (JSON_ERROR_NONE !== json_last_error()) { throw new InvalidResponseException(Exception::UNPACK_RESPONSE_ERROR, 'Unpack Response Error', ['contents' => $contents, 'response' => $response]); } return $result; } }