IClient
Interface IClient
Tags
Table of Contents
- delete() : IResponse
- Sends a DELETE request
- get() : IResponse
- Sends a GET request
- head() : IResponse
- Sends a HEAD request
- options() : IResponse
- Sends a options request
- post() : IResponse
- Sends a POST request
- put() : IResponse
- Sends a PUT request
Methods
delete()
Sends a DELETE request
public
delete(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,
Tags
Return values
IResponse —get()
Sends a GET request
public
get(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,
Tags
Return values
IResponse —head()
Sends a HEAD request
public
head(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,
Tags
Return values
IResponse —options()
Sends a options request
public
options(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,
Tags
Return values
IResponse —post()
Sends a POST request
public
post(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,
Tags
Return values
IResponse —put()
Sends a PUT request
public
put(string $uri[, array $options = [] ]) : IResponse
Parameters
- $uri : string
- $options : array = []
-
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 ], 'save_to' => '/path/to/file', // save to a file or a stream 'verify' => true, // bool or string to CA file 'debug' => true,