Documentation

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
throws
GuzzleException
Return values
ResponseInterface

deleteAsync()

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
PromiseInterface

get()

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
throws
GuzzleException
Return values
ResponseInterface

getAsync()

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
PromiseInterface

head()

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
throws
GuzzleException
Return values
ResponseInterface

headAsync()

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
PromiseInterface

patch()

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
throws
GuzzleException
Return values
ResponseInterface

patchAsync()

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
PromiseInterface

post()

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
throws
GuzzleException
Return values
ResponseInterface

postAsync()

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
PromiseInterface

put()

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
throws
GuzzleException
Return values
ResponseInterface

putAsync()

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
PromiseInterface

request()

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
throws
GuzzleException
Return values
ResponseInterface

requestAsync()

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.

Return values
PromiseInterface

        
On this page

Search results