blob: bc04e1f722d5bf98015fd1827e64b94d485e0da3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
|
<?php
/**
* HTTP Client library
*
* PHP version 5.4
*
* @author Matt Bernier <dx@sendgrid.com>
* @author Elmer Thomas <dx@sendgrid.com>
* @copyright 2016 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 = null, $body = null, $headers = null)
{
$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
*
* @return array
*/
public function headers()
{
return $this->headers;
}
}
|