4 use GuzzleHttp\Promise\PromiseInterface;
5 use GuzzleHttp\Exception\GuzzleException;
6 use Psr\Http\Message\RequestInterface;
7 use Psr\Http\Message\ResponseInterface;
8 use Psr\Http\Message\UriInterface;
11 * Client interface for sending HTTP requests.
13 interface ClientInterface
15 const VERSION = '6.2.1';
18 * Send an HTTP request.
20 * @param RequestInterface $request Request to send
21 * @param array $options Request options to apply to the given
22 * request and to the transfer.
24 * @return ResponseInterface
25 * @throws GuzzleException
27 public function send(RequestInterface $request, array $options = []);
30 * Asynchronously send an HTTP request.
32 * @param RequestInterface $request Request to send
33 * @param array $options Request options to apply to the given
34 * request and to the transfer.
36 * @return PromiseInterface
38 public function sendAsync(RequestInterface $request, array $options = []);
41 * Create and send an HTTP request.
43 * Use an absolute path to override the base path of the client, or a
44 * relative path to append to the base path of the client. The URL can
45 * contain the query string as well.
47 * @param string $method HTTP method.
48 * @param string|UriInterface $uri URI object or string.
49 * @param array $options Request options to apply.
51 * @return ResponseInterface
52 * @throws GuzzleException
54 public function request($method, $uri, array $options = []);
57 * Create and send an asynchronous HTTP request.
59 * Use an absolute path to override the base path of the client, or a
60 * relative path to append to the base path of the client. The URL can
61 * contain the query string as well. Use an array to provide a URL
62 * template and additional variables to use in the URL template expansion.
64 * @param string $method HTTP method
65 * @param string|UriInterface $uri URI object or string.
66 * @param array $options Request options to apply.
68 * @return PromiseInterface
70 public function requestAsync($method, $uri, array $options = []);
73 * Get a client configuration option.
75 * These options include default request options of the client, a "handler"
76 * (if utilized by the concrete client), and a "base_uri" if utilized by
77 * the concrete client.
79 * @param string|null $option The config option to retrieve.
83 public function getConfig($option = null);