\GuzzleHttpClientInterface

Client interface for sending HTTP requests.

Summary

Methods
Constants
send()
sendAsync()
request()
requestAsync()
getConfig()
VERSION
No protected methods found
N/A
No private methods found
N/A

Constants

VERSION

VERSION = '6.4.1'

Methods

send()

send(\Psr\Http\Message\RequestInterface  $request, array  $options = array()) : \Psr\Http\Message\ResponseInterface

Send an HTTP request.

Parameters

\Psr\Http\Message\RequestInterface $request

Request to send

array $options

Request options to apply to the given request and to the transfer.

Throws

\GuzzleHttp\Exception\GuzzleException

Returns

\Psr\Http\Message\ResponseInterface

sendAsync()

sendAsync(\Psr\Http\Message\RequestInterface  $request, array  $options = array()) : \GuzzleHttp\Promise\PromiseInterface

Asynchronously send an HTTP request.

Parameters

\Psr\Http\Message\RequestInterface $request

Request to send

array $options

Request options to apply to the given request and to the transfer.

Returns

\GuzzleHttp\Promise\PromiseInterface

request()

request(string  $method, string|\Psr\Http\Message\UriInterface  $uri, array  $options = array()) : \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

requestAsync()

requestAsync(string  $method, string|\Psr\Http\Message\UriInterface  $uri, array  $options = array()) : \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

getConfig()

getConfig(string|null  $option = null) : mixed

Get a client configuration option.

These options include default request options of the client, a "handler" (if utilized by the concrete client), and a "base_uri" if utilized by the concrete client.

Parameters

string|null $option

The config option to retrieve.

Returns

mixed