IClient¶
-
interface
OCP\Http\Client\
IClient
¶ - Interface IClient
Implemented by: OC\Http\Client\Client
Source: lib/public/Http/Client/IClient.php#35
Methods¶
-
public
OCP\Http\Client\IClient::
get
($uri, $options=[])¶ - Sends a GET request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0
-
public
OCP\Http\Client\IClient::
head
($uri, $options=[])¶ - Sends a HEAD request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0
-
public
OCP\Http\Client\IClient::
post
($uri, $options=[])¶ - Sends a POST request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0
-
public
OCP\Http\Client\IClient::
put
($uri, $options=[])¶ - Sends a PUT request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0
-
public
OCP\Http\Client\IClient::
delete
($uri, $options=[])¶ - Sends a DELETE request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0
-
public
OCP\Http\Client\IClient::
options
($uri, $options=[])¶ - Sends a options request
Source: 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
], ‘sink’ => ‘/path/to/file’, // save to a file or a stream ‘verify’ => true, // bool or string to CA file ‘debug’ => true,
Returns: Throws: \Exception
If the request could not get completedSince: 8.1.0