diff options
Diffstat (limited to 'lib/public/Http/Client/IClient.php')
-rw-r--r-- | lib/public/Http/Client/IClient.php | 183 |
1 files changed, 176 insertions, 7 deletions
diff --git a/lib/public/Http/Client/IClient.php b/lib/public/Http/Client/IClient.php index d692edc5b71..fb1760c25f2 100644 --- a/lib/public/Http/Client/IClient.php +++ b/lib/public/Http/Client/IClient.php @@ -44,7 +44,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -69,7 +69,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -99,7 +99,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -129,7 +129,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -159,7 +159,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -178,7 +178,7 @@ interface IClient { public function delete(string $uri, array $options = []): IResponse; /** - * Sends a options request + * Sends an OPTIONS request * @param string $uri * @param array $options Array such as * 'body' => [ @@ -189,7 +189,7 @@ interface IClient { * 'headers' => [ * 'foo' => 'bar', * ], - * 'cookies' => [' + * 'cookies' => [ * 'foo' => 'bar', * ], * 'allow_redirects' => [ @@ -206,4 +206,173 @@ interface IClient { * @since 8.1.0 */ public function options(string $uri, array $options = []): IResponse; + + /** + * Sends an asynchronous GET request + * @param string $uri + * @param array $options Array such as + * 'query' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function getAsync(string $uri, array $options = []): IPromise; + + /** + * Sends an asynchronous HEAD request + * @param string $uri + * @param array $options Array such as + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function headAsync(string $uri, array $options = []): IPromise; + + /** + * Sends an asynchronous POST request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function postAsync(string $uri, array $options = []): IPromise; + + /** + * Sends an asynchronous PUT request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function putAsync(string $uri, array $options = []): IPromise; + + /** + * Sends an asynchronous DELETE request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function deleteAsync(string $uri, array $options = []): IPromise; + + /** + * Sends an asynchronous OPTIONS request + * @param string $uri + * @param array $options Array such as + * 'body' => [ + * 'field' => 'abc', + * 'other_field' => '123', + * 'file_name' => fopen('/path/to/file', 'r'), + * ], + * 'headers' => [ + * 'foo' => 'bar', + * ], + * 'cookies' => [ + * 'foo' => 'bar', + * ], + * 'allow_redirects' => [ + * 'max' => 10, // allow at most 10 redirects. + * 'strict' => true, // use "strict" RFC compliant redirects. + * 'referer' => true, // add a Referer header + * 'protocols' => ['https'] // only allow https URLs + * ], + * 'sink' => '/path/to/file', // save to a file or a stream + * 'verify' => true, // bool or string to CA file + * 'debug' => true, + * @return IPromise + * @since 28.0.0 + */ + public function optionsAsync(string $uri, array $options = []): IPromise; } |