%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
<?php /** * HTTP Client library * * @author Matt Bernier <dx@sendgrid.com> * @author Elmer Thomas <dx@sendgrid.com> * @copyright 2018 SendGrid * @license https://opensource.org/licenses/MIT The MIT License * @version GIT: <git_id> * @link http://packagist.org/packages/sendgrid/php-http-client */ namespace SendGrid; /** * Holds the response from an API call. */ class Response { /** * @var int */ protected $statusCode; /** * @var string */ protected $body; /** * @var array */ protected $headers; /** * Setup the response data * * @param int $statusCode the status code. * @param string $body the response body. * @param array $headers an array of response headers. */ public function __construct($statusCode = 200, $body = '', array $headers = []) { $this->statusCode = $statusCode; $this->body = $body; $this->headers = $headers; } /** * The status code * * @return int */ public function statusCode() { return $this->statusCode; } /** * The response body * * @return string */ public function body() { return $this->body; } /** * The response headers * * @param bool $assoc * * @return array */ public function headers($assoc = false) { if (!$assoc) { return $this->headers; } return $this->prettifyHeaders($this->headers); } /** * Returns response headers as associative array * * @param array $headers * * @return array */ private function prettifyHeaders(array $headers) { return array_reduce( array_filter($headers), function ($result, $header) { if (false === strpos($header, ':')) { $result['Status'] = trim($header); return $result; } list($key, $value) = explode(':', $header, 2); $result[trim($key)] = trim($value); return $result; }, [] ); } }