1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
/* |
4
|
|
|
* This file is part of the Ivory Http Adapter package. |
5
|
|
|
* |
6
|
|
|
* (c) Eric GELOEN <[email protected]> |
7
|
|
|
* |
8
|
|
|
* For the full copyright and license information, please read the LICENSE |
9
|
|
|
* file that was distributed with this source code. |
10
|
|
|
*/ |
11
|
|
|
|
12
|
|
|
namespace Ivory\HttpAdapter; |
13
|
|
|
|
14
|
|
|
use Ivory\HttpAdapter\Message\ResponseInterface; |
15
|
|
|
|
16
|
|
|
/** |
17
|
|
|
* @author GeLo <[email protected]> |
18
|
|
|
*/ |
19
|
|
|
interface HttpAdapterInterface extends PsrHttpAdapterInterface |
20
|
|
|
{ |
21
|
|
|
/** |
22
|
|
|
* @param string|object $uri |
23
|
|
|
* @param array $headers |
24
|
|
|
* |
25
|
|
|
* @throws HttpAdapterException |
26
|
|
|
* |
27
|
|
|
* @return ResponseInterface |
28
|
|
|
*/ |
29
|
|
|
public function get($uri, array $headers = []); |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* @param string|object $uri |
33
|
|
|
* @param array $headers |
34
|
|
|
* |
35
|
|
|
* @throws HttpAdapterException |
36
|
|
|
* |
37
|
|
|
* @return ResponseInterface |
38
|
|
|
*/ |
39
|
|
|
public function head($uri, array $headers = []); |
40
|
|
|
|
41
|
|
|
/** |
42
|
|
|
* @param string|object $uri |
43
|
|
|
* @param array $headers |
44
|
|
|
* |
45
|
|
|
* @throws HttpAdapterException |
46
|
|
|
* |
47
|
|
|
* @return ResponseInterface |
48
|
|
|
*/ |
49
|
|
|
public function trace($uri, array $headers = []); |
50
|
|
|
|
51
|
|
|
/** |
52
|
|
|
* @param string|object $uri |
53
|
|
|
* @param array $headers |
54
|
|
|
* @param array|string $datas |
55
|
|
|
* @param array $files |
56
|
|
|
* |
57
|
|
|
* @throws HttpAdapterException |
58
|
|
|
* |
59
|
|
|
* @return ResponseInterface |
60
|
|
|
*/ |
61
|
|
|
public function post($uri, array $headers = [], $datas = [], array $files = []); |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @param string|object $uri |
65
|
|
|
* @param array $headers |
66
|
|
|
* @param array|string $datas |
67
|
|
|
* @param array $files |
68
|
|
|
* |
69
|
|
|
* @throws HttpAdapterException |
70
|
|
|
* |
71
|
|
|
* @return ResponseInterface |
72
|
|
|
*/ |
73
|
|
|
public function put($uri, array $headers = [], $datas = [], array $files = []); |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @param string|object $uri |
77
|
|
|
* @param array $headers |
78
|
|
|
* @param array|string $datas |
79
|
|
|
* @param array $files |
80
|
|
|
* |
81
|
|
|
* @throws HttpAdapterException |
82
|
|
|
* |
83
|
|
|
* @return ResponseInterface |
84
|
|
|
*/ |
85
|
|
|
public function patch($uri, array $headers = [], $datas = [], array $files = []); |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @param string|object $uri |
89
|
|
|
* @param array $headers |
90
|
|
|
* @param array|string $datas |
91
|
|
|
* @param array $files |
92
|
|
|
* |
93
|
|
|
* @throws HttpAdapterException |
94
|
|
|
* |
95
|
|
|
* @return ResponseInterface |
96
|
|
|
*/ |
97
|
|
|
public function delete($uri, array $headers = [], $datas = [], array $files = []); |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @param string|object $uri |
101
|
|
|
* @param array $headers |
102
|
|
|
* @param array|string $datas |
103
|
|
|
* @param array $files |
104
|
|
|
* |
105
|
|
|
* @throws HttpAdapterException |
106
|
|
|
* |
107
|
|
|
* @return ResponseInterface |
108
|
|
|
*/ |
109
|
|
|
public function options($uri, array $headers = [], $datas = [], array $files = []); |
110
|
|
|
|
111
|
|
|
/** |
112
|
|
|
* @param string|object $uri |
113
|
|
|
* @param string $method |
114
|
|
|
* @param array $headers |
115
|
|
|
* @param array|string $datas |
116
|
|
|
* @param array $files |
117
|
|
|
* |
118
|
|
|
* @throws HttpAdapterException |
119
|
|
|
* |
120
|
|
|
* @return ResponseInterface |
121
|
|
|
*/ |
122
|
|
|
public function send($uri, $method, array $headers = [], $datas = [], array $files = []); |
123
|
|
|
} |
124
|
|
|
|