1 | <?php |
||
19 | class FileSender |
||
20 | { |
||
21 | /** |
||
22 | * @var ClientInterface |
||
23 | */ |
||
24 | private $client; |
||
25 | |||
26 | /** |
||
27 | * @param ClientInterface $client real guzzle client |
||
28 | */ |
||
29 | 13 | public function __construct(ClientInterface $client) |
|
33 | |||
34 | /** |
||
35 | * Create and send an asynchronous HTTP request sending a file if needed. |
||
36 | * |
||
37 | * Use an absolute path to override the base path of the client, or a |
||
38 | * relative path to append to the base path of the client. The URL can |
||
39 | * contain the query string as well. Use an array to provide a URL |
||
40 | * template and additional variables to use in the URL template expansion. |
||
41 | * |
||
42 | * @param string $method HTTP method |
||
43 | * @param string|UriInterface $uri URI object or string. |
||
44 | * @param array $options Request options to apply. |
||
45 | * |
||
46 | * @return PromiseInterface |
||
47 | */ |
||
48 | 5 | public function requestAsync($method, $uri, array $options = []) |
|
52 | |||
53 | /** |
||
54 | * Create and send an HTTP request sending a file as needed. |
||
55 | * |
||
56 | * Use an absolute path to override the base path of the client, or a |
||
57 | * relative path to append to the base path of the client. The URL can |
||
58 | * contain the query string as well. |
||
59 | * |
||
60 | * @param string $method HTTP method |
||
61 | * @param string|UriInterface $uri URI object or string. |
||
62 | * @param array $options Request options to apply. |
||
63 | * |
||
64 | * @return ResponseInterface |
||
65 | * @throws GuzzleException |
||
66 | */ |
||
67 | 4 | public function request($method, $uri, array $options = []) |
|
71 | |||
72 | |||
73 | /** |
||
74 | * @param array $options Curl data options |
||
75 | * @return array options |
||
76 | */ |
||
77 | 9 | private function checkFileUploadRequest($options) |
|
105 | } |
||
106 |