\GuzzleHttpClientTrait

Client interface for sending HTTP requests.

Summary

Methods
Properties
Constants
request()
get()
head()
put()
post()
patch()
delete()
requestAsync()
getAsync()
headAsync()
putAsync()
postAsync()
patchAsync()
deleteAsync()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
No private methods found
No private properties found
N/A

Methods

request()

request(string  $method, string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP request.

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

string $method

HTTP method.

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

get()

get(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP GET request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

head()

head(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP HEAD request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

put()

put(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP PUT request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

post()

post(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP POST request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

patch()

patch(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP PATCH request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

delete()

delete(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \Psr\Http\Message\ResponseInterface

Create and send an HTTP DELETE request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface —

requestAsync()

requestAsync(string  $method, string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP request.

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

string $method

HTTP method

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

getAsync()

getAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP GET request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

headAsync()

headAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP HEAD request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

putAsync()

putAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP PUT request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

postAsync()

postAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP POST request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

patchAsync()

patchAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP PATCH request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —

deleteAsync()

deleteAsync(string|\Psr\Http\Message\UriInterface  $uri, array  $options = []) : \GuzzleHttp\Promise\PromiseInterface

Create and send an asynchronous HTTP DELETE request.

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

string|\Psr\Http\Message\UriInterface $uri

URI object or string.

array $options

Request options to apply.

Returns

\GuzzleHttp\Promise\PromiseInterface —