PluginProbe
DecaLog / 4.4.0
DecaLog v4.4.0
3.0.2 3.1.0 3.10.0 3.2.0 3.3.0 3.4.0 3.4.1 3.5.0 3.5.1 3.6.0 3.6.1 3.6.2 3.6.3 3.7.0 3.7.1 3.8.0 3.9.0 3.9.1 4.0.0 4.1.0 4.2.0 4.3.0 4.3.1 4.4.0 4.5.0 All 75 releases
decalog / includes / libraries / http / client-common / HttpMethodsClientInterface.php

HttpMethodsClientInterface.php in DecaLog 4.4.0, at includes/libraries/http/client-common/HttpMethodsClientInterface.php

117 lines 2.9 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 declare(strict_types=1);
4
5 namespace Http\Client\Common;
6
7 use Http\Client\Exception;
8 use Http\Client\HttpClient;
9 use Psr\Http\Message\ResponseInterface;
10 use Psr\Http\Message\StreamInterface;
11 use Psr\Http\Message\UriInterface;
12
13 /**
14 * Convenience HTTP client that integrates the MessageFactory in order to send
15 * requests in the following form:.
16 *
17 * $client
18 * ->get('/foo')
19 * ->post('/bar')
20 * ;
21 *
22 * The client also exposes the sendRequest methods of the wrapped HttpClient.
23 *
24 * @author Márk Sági-Kazár <mark.sagikazar@gmail.com>
25 * @author David Buchmann <mail@davidbu.ch>
26 */
27 interface HttpMethodsClientInterface extends HttpClient
28 {
29 /**
30 * Sends a GET request.
31 *
32 * @param string|UriInterface $uri
33 *
34 * @throws Exception
35 */
36 public function get($uri, array $headers = []): ResponseInterface;
37
38 /**
39 * Sends an HEAD request.
40 *
41 * @param string|UriInterface $uri
42 *
43 * @throws Exception
44 */
45 public function head($uri, array $headers = []): ResponseInterface;
46
47 /**
48 * Sends a TRACE request.
49 *
50 * @param string|UriInterface $uri
51 *
52 * @throws Exception
53 */
54 public function trace($uri, array $headers = []): ResponseInterface;
55
56 /**
57 * Sends a POST request.
58 *
59 * @param string|UriInterface $uri
60 * @param string|StreamInterface|null $body
61 *
62 * @throws Exception
63 */
64 public function post($uri, array $headers = [], $body = null): ResponseInterface;
65
66 /**
67 * Sends a PUT request.
68 *
69 * @param string|UriInterface $uri
70 * @param string|StreamInterface|null $body
71 *
72 * @throws Exception
73 */
74 public function put($uri, array $headers = [], $body = null): ResponseInterface;
75
76 /**
77 * Sends a PATCH request.
78 *
79 * @param string|UriInterface $uri
80 * @param string|StreamInterface|null $body
81 *
82 * @throws Exception
83 */
84 public function patch($uri, array $headers = [], $body = null): ResponseInterface;
85
86 /**
87 * Sends a DELETE request.
88 *
89 * @param string|UriInterface $uri
90 * @param string|StreamInterface|null $body
91 *
92 * @throws Exception
93 */
94 public function delete($uri, array $headers = [], $body = null): ResponseInterface;
95
96 /**
97 * Sends an OPTIONS request.
98 *
99 * @param string|UriInterface $uri
100 * @param string|StreamInterface|null $body
101 *
102 * @throws Exception
103 */
104 public function options($uri, array $headers = [], $body = null): ResponseInterface;
105
106 /**
107 * Sends a request with any HTTP method.
108 *
109 * @param string $method HTTP method to use
110 * @param string|UriInterface $uri
111 * @param string|StreamInterface|null $body
112 *
113 * @throws Exception
114 */
115 public function send(string $method, $uri, array $headers = [], $body = null): ResponseInterface;
116 }
117