ClientTrait
Client interface for sending HTTP requests.
Table of Contents
Methods
- delete() : ResponseInterface
- Create and send an HTTP DELETE request.
- deleteAsync() : PromiseInterface
- Create and send an asynchronous HTTP DELETE request.
- get() : ResponseInterface
- Create and send an HTTP GET request.
- getAsync() : PromiseInterface
- Create and send an asynchronous HTTP GET request.
- head() : ResponseInterface
- Create and send an HTTP HEAD request.
- headAsync() : PromiseInterface
- Create and send an asynchronous HTTP HEAD request.
- patch() : ResponseInterface
- Create and send an HTTP PATCH request.
- patchAsync() : PromiseInterface
- Create and send an asynchronous HTTP PATCH request.
- post() : ResponseInterface
- Create and send an HTTP POST request.
- postAsync() : PromiseInterface
- Create and send an asynchronous HTTP POST request.
- put() : ResponseInterface
- Create and send an HTTP PUT request.
- putAsync() : PromiseInterface
- Create and send an asynchronous HTTP PUT request.
- request() : ResponseInterface
- Create and send an HTTP request.
- requestAsync() : PromiseInterface
- Create and send an asynchronous HTTP request.
Methods
delete()
Create and send an HTTP DELETE request.
public
delete(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfacedeleteAsync()
Create and send an asynchronous HTTP DELETE request.
public
deleteAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfaceget()
Create and send an HTTP GET request.
public
get(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfacegetAsync()
Create and send an asynchronous HTTP GET request.
public
getAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfacehead()
Create and send an HTTP HEAD request.
public
head(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfaceheadAsync()
Create and send an asynchronous HTTP HEAD request.
public
headAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfacepatch()
Create and send an HTTP PATCH request.
public
patch(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfacepatchAsync()
Create and send an asynchronous HTTP PATCH request.
public
patchAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfacepost()
Create and send an HTTP POST request.
public
post(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfacepostAsync()
Create and send an asynchronous HTTP POST request.
public
postAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfaceput()
Create and send an HTTP PUT request.
public
put(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfaceputAsync()
Create and send an asynchronous HTTP PUT request.
public
putAsync(string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Return values
PromiseInterfacerequest()
Create and send an HTTP request.
public
abstract request(string $method, string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well.
Parameters
- $method : string
-
HTTP method.
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.
Tags
Return values
ResponseInterfacerequestAsync()
Create and send an asynchronous HTTP request.
public
abstract requestAsync(string $method, string|UriInterface $uri[, array<string|int, mixed> $options = [] ]) : PromiseInterface
Use an absolute path to override the base path of the client, or a relative path to append to the base path of the client. The URL can contain the query string as well. Use an array to provide a URL template and additional variables to use in the URL template expansion.
Parameters
- $method : string
-
HTTP method
- $uri : string|UriInterface
-
URI object or string.
- $options : array<string|int, mixed> = []
-
Request options to apply.