Chris@0
|
1 <?php
|
Chris@0
|
2 namespace GuzzleHttp;
|
Chris@0
|
3
|
Chris@0
|
4 use GuzzleHttp\Promise\PromiseInterface;
|
Chris@0
|
5 use GuzzleHttp\Exception\GuzzleException;
|
Chris@0
|
6 use Psr\Http\Message\RequestInterface;
|
Chris@0
|
7 use Psr\Http\Message\ResponseInterface;
|
Chris@0
|
8 use Psr\Http\Message\UriInterface;
|
Chris@0
|
9
|
Chris@0
|
10 /**
|
Chris@0
|
11 * Client interface for sending HTTP requests.
|
Chris@0
|
12 */
|
Chris@0
|
13 interface ClientInterface
|
Chris@0
|
14 {
|
Chris@13
|
15 const VERSION = '6.3.3';
|
Chris@0
|
16
|
Chris@0
|
17 /**
|
Chris@0
|
18 * Send an HTTP request.
|
Chris@0
|
19 *
|
Chris@0
|
20 * @param RequestInterface $request Request to send
|
Chris@0
|
21 * @param array $options Request options to apply to the given
|
Chris@0
|
22 * request and to the transfer.
|
Chris@0
|
23 *
|
Chris@0
|
24 * @return ResponseInterface
|
Chris@0
|
25 * @throws GuzzleException
|
Chris@0
|
26 */
|
Chris@0
|
27 public function send(RequestInterface $request, array $options = []);
|
Chris@0
|
28
|
Chris@0
|
29 /**
|
Chris@0
|
30 * Asynchronously send an HTTP request.
|
Chris@0
|
31 *
|
Chris@0
|
32 * @param RequestInterface $request Request to send
|
Chris@0
|
33 * @param array $options Request options to apply to the given
|
Chris@0
|
34 * request and to the transfer.
|
Chris@0
|
35 *
|
Chris@0
|
36 * @return PromiseInterface
|
Chris@0
|
37 */
|
Chris@0
|
38 public function sendAsync(RequestInterface $request, array $options = []);
|
Chris@0
|
39
|
Chris@0
|
40 /**
|
Chris@0
|
41 * Create and send an HTTP request.
|
Chris@0
|
42 *
|
Chris@0
|
43 * Use an absolute path to override the base path of the client, or a
|
Chris@0
|
44 * relative path to append to the base path of the client. The URL can
|
Chris@0
|
45 * contain the query string as well.
|
Chris@0
|
46 *
|
Chris@0
|
47 * @param string $method HTTP method.
|
Chris@0
|
48 * @param string|UriInterface $uri URI object or string.
|
Chris@0
|
49 * @param array $options Request options to apply.
|
Chris@0
|
50 *
|
Chris@0
|
51 * @return ResponseInterface
|
Chris@0
|
52 * @throws GuzzleException
|
Chris@0
|
53 */
|
Chris@0
|
54 public function request($method, $uri, array $options = []);
|
Chris@0
|
55
|
Chris@0
|
56 /**
|
Chris@0
|
57 * Create and send an asynchronous HTTP request.
|
Chris@0
|
58 *
|
Chris@0
|
59 * Use an absolute path to override the base path of the client, or a
|
Chris@0
|
60 * relative path to append to the base path of the client. The URL can
|
Chris@0
|
61 * contain the query string as well. Use an array to provide a URL
|
Chris@0
|
62 * template and additional variables to use in the URL template expansion.
|
Chris@0
|
63 *
|
Chris@0
|
64 * @param string $method HTTP method
|
Chris@0
|
65 * @param string|UriInterface $uri URI object or string.
|
Chris@0
|
66 * @param array $options Request options to apply.
|
Chris@0
|
67 *
|
Chris@0
|
68 * @return PromiseInterface
|
Chris@0
|
69 */
|
Chris@0
|
70 public function requestAsync($method, $uri, array $options = []);
|
Chris@0
|
71
|
Chris@0
|
72 /**
|
Chris@0
|
73 * Get a client configuration option.
|
Chris@0
|
74 *
|
Chris@0
|
75 * These options include default request options of the client, a "handler"
|
Chris@0
|
76 * (if utilized by the concrete client), and a "base_uri" if utilized by
|
Chris@0
|
77 * the concrete client.
|
Chris@0
|
78 *
|
Chris@0
|
79 * @param string|null $option The config option to retrieve.
|
Chris@0
|
80 *
|
Chris@0
|
81 * @return mixed
|
Chris@0
|
82 */
|
Chris@0
|
83 public function getConfig($option = null);
|
Chris@0
|
84 }
|