11
11
12
12
namespace Http \Adapter ;
13
13
14
+ use Psr \Http \Message \StreamInterface ;
14
15
use Psr \Http \Message \UriInterface ;
15
16
use Psr \Http \Message \ResponseInterface ;
16
17
@@ -25,7 +26,8 @@ interface HttpAdapter extends PsrHttpAdapter
25
26
* @param string|UriInterface $uri
26
27
* @param string[] $headers
27
28
*
28
- * @throws HttpAdapterException If an error occurred.
29
+ * @throws \InvalidArgumentException If an argument is not valid.
30
+ * @throws HttpAdapterException If an http error occurred.
29
31
*
30
32
* @return ResponseInterface
31
33
*/
@@ -37,7 +39,8 @@ public function get($uri, array $headers = []);
37
39
* @param string|UriInterface $uri
38
40
* @param string[] $headers
39
41
*
40
- * @throws HttpAdapterException If an error occurred.
42
+ * @throws \InvalidArgumentException If an argument is not valid.
43
+ * @throws HttpAdapterException If an http error occurred.
41
44
*
42
45
* @return ResponseInterface
43
46
*/
@@ -49,7 +52,8 @@ public function head($uri, array $headers = []);
49
52
* @param string|UriInterface $uri
50
53
* @param string[] $headers
51
54
*
52
- * @throws HttpAdapterException If an error occurred.
55
+ * @throws \InvalidArgumentException If an argument is not valid.
56
+ * @throws HttpAdapterException If an http error occurred.
53
57
*
54
58
* @return ResponseInterface
55
59
*/
@@ -58,12 +62,13 @@ public function trace($uri, array $headers = []);
58
62
/**
59
63
* Sends a POST request
60
64
*
61
- * @param string|UriInterface $uri
62
- * @param string[] $headers
63
- * @param array|string $data
64
- * @param array $files
65
+ * @param string|UriInterface $uri
66
+ * @param string[] $headers
67
+ * @param array|string|StreamInterface $data
68
+ * @param array $files
65
69
*
66
- * @throws HttpAdapterException If an error occurred.
70
+ * @throws \InvalidArgumentException If an argument is not valid.
71
+ * @throws HttpAdapterException If an http error occurred.
67
72
*
68
73
* @return ResponseInterface
69
74
*/
@@ -72,12 +77,13 @@ public function post($uri, array $headers = [], $data = [], array $files = []);
72
77
/**
73
78
* Sends a PUT request
74
79
*
75
- * @param string|UriInterface $uri
76
- * @param string[] $headers
77
- * @param array|string $data
78
- * @param array $files
80
+ * @param string|UriInterface $uri
81
+ * @param string[] $headers
82
+ * @param array|string|StreamInterface $data
83
+ * @param array $files
79
84
*
80
- * @throws HttpAdapterException If an error occurred.
85
+ * @throws \InvalidArgumentException If an argument is not valid.
86
+ * @throws HttpAdapterException If an http error occurred.
81
87
*
82
88
* @return ResponseInterface
83
89
*/
@@ -86,12 +92,13 @@ public function put($uri, array $headers = [], $data = [], array $files = []);
86
92
/**
87
93
* Sends a PATCH request
88
94
*
89
- * @param string|UriInterface $uri
90
- * @param string[] $headers
91
- * @param array|string $data
92
- * @param array $files
95
+ * @param string|UriInterface $uri
96
+ * @param string[] $headers
97
+ * @param array|string|StreamInterface $data
98
+ * @param array $files
93
99
*
94
- * @throws HttpAdapterException If an error occurred.
100
+ * @throws \InvalidArgumentException If an argument is not valid.
101
+ * @throws HttpAdapterException If an http error occurred.
95
102
*
96
103
* @return ResponseInterface
97
104
*/
@@ -100,12 +107,13 @@ public function patch($uri, array $headers = [], $data = [], array $files = []);
100
107
/**
101
108
* Sends a DELETE request
102
109
*
103
- * @param string|UriInterface $uri
104
- * @param string[] $headers
105
- * @param array|string $data
106
- * @param array $files
110
+ * @param string|UriInterface $uri
111
+ * @param string[] $headers
112
+ * @param array|string|StreamInterface $data
113
+ * @param array $files
107
114
*
108
- * @throws HttpAdapterException If an error occurred.
115
+ * @throws \InvalidArgumentException If an argument is not valid.
116
+ * @throws HttpAdapterException If an http error occurred.
109
117
*
110
118
* @return ResponseInterface
111
119
*/
@@ -114,12 +122,13 @@ public function delete($uri, array $headers = [], $data = [], array $files = [])
114
122
/**
115
123
* Sends an OPTIONS request
116
124
*
117
- * @param string|UriInterface $uri
118
- * @param string[] $headers
119
- * @param array|string $data
120
- * @param array $files
125
+ * @param string|UriInterface $uri
126
+ * @param string[] $headers
127
+ * @param array|string|StreamInterface $data
128
+ * @param array $files
121
129
*
122
- * @throws HttpAdapterException If an error occurred.
130
+ * @throws \InvalidArgumentException If an argument is not valid.
131
+ * @throws HttpAdapterException If an http error occurred.
123
132
*
124
133
* @return ResponseInterface
125
134
*/
@@ -128,13 +137,14 @@ public function options($uri, array $headers = [], $data = [], array $files = []
128
137
/**
129
138
* Sends a request
130
139
*
131
- * @param string $method
132
- * @param string|UriInterface $uri
133
- * @param string[] $headers
134
- * @param array|string $data
135
- * @param array $files
140
+ * @param string $method
141
+ * @param string|UriInterface $uri
142
+ * @param string[] $headers
143
+ * @param array|string|StreamInterface $data
144
+ * @param array $files
136
145
*
137
- * @throws HttpAdapterException If an error occurred.
146
+ * @throws \InvalidArgumentException If an argument is not valid.
147
+ * @throws HttpAdapterException If an http error occurred.
138
148
*
139
149
* @return ResponseInterface
140
150
*/
0 commit comments