blob: c0ae9be93b618272fd66a9788766f556e862e41f (
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
|
<?php
namespace GuzzleHttp\Message;
/**
* Represents an HTTP response message.
*/
interface ResponseInterface extends MessageInterface
{
/**
* Gets the response Status-Code.
*
* The Status-Code is a 3-digit integer result code of the server's attempt
* to understand and satisfy the request.
*
* @return int Status code.
*/
public function getStatusCode();
/**
* Sets the status code of this response.
*
* @param int $code The 3-digit integer result code to set.
*/
public function setStatusCode($code);
/**
* Gets the response Reason-Phrase, a short textual description of the
* Status-Code.
*
* Because a Reason-Phrase is not a required element in response
* Status-Line, the Reason-Phrase value MAY be null. Implementations MAY
* choose to return the default RFC 2616 recommended reason phrase for the
* response's Status-Code.
*
* @return string|null Reason phrase, or null if unknown.
*/
public function getReasonPhrase();
/**
* Sets the Reason-Phrase of the response.
*
* If no Reason-Phrase is specified, implementations MAY choose to default
* to the RFC 2616 recommended reason phrase for the response's Status-Code.
*
* @param string $phrase The Reason-Phrase to set.
*/
public function setReasonPhrase($phrase);
/**
* Get the effective URL that resulted in this response (e.g. the last
* redirect URL).
*
* @return string
*/
public function getEffectiveUrl();
/**
* Set the effective URL that resulted in this response (e.g. the last
* redirect URL).
*
* @param string $url Effective URL
*/
public function setEffectiveUrl($url);
/**
* Parse the JSON response body and return the JSON decoded data.
*
* @param array $config Associative array of configuration settings used
* to control how the JSON data is parsed. Concrete implementations MAY
* add further configuration settings as needed, but they MUST implement
* functionality for the following options:
*
* - object: Set to true to parse JSON objects as PHP objects rather
* than associative arrays. Defaults to false.
* - big_int_strings: When set to true, large integers are converted to
* strings rather than floats. Defaults to false.
*
* Implementations are free to add further configuration settings as
* needed.
*
* @return mixed Returns the JSON decoded data based on the provided
* parse settings.
* @throws \RuntimeException if the response body is not in JSON format
*/
public function json(array $config = []);
/**
* Parse the XML response body and return a \SimpleXMLElement.
*
* In order to prevent XXE attacks, this method disables loading external
* entities. If you rely on external entities, then you must parse the
* XML response manually by accessing the response body directly.
*
* @param array $config Associative array of configuration settings used
* to control how the XML is parsed. Concrete implementations MAY add
* further configuration settings as needed, but they MUST implement
* functionality for the following options:
*
* - ns: Set to a string to represent the namespace prefix or URI
* - ns_is_prefix: Set to true to specify that the NS is a prefix rather
* than a URI (defaults to false).
* - libxml_options: Bitwise OR of the libxml option constants
* listed at http://php.net/manual/en/libxml.constants.php
* (defaults to LIBXML_NONET)
*
* @return \SimpleXMLElement
* @throws \RuntimeException if the response body is not in XML format
* @link http://websec.io/2012/08/27/Preventing-XXE-in-PHP.html
*/
public function xml(array $config = []);
}
|