Documentation

ClientInterface
in

Client interface for sending HTTP requests.

Table of Contents

VERSION  = '6.5.5'
getConfig()  : mixed
Get a client configuration option.
request()  : ResponseInterface
Create and send an HTTP request.
requestAsync()  : PromiseInterface
Create and send an asynchronous HTTP request.
send()  : ResponseInterface
Send an HTTP request.
sendAsync()  : PromiseInterface
Asynchronously send an HTTP request.

Constants

VERSION

public mixed VERSION = '6.5.5'
Tags
deprecated

Will be removed in Guzzle 7.0.0

Methods

getConfig()

Get a client configuration option.

public getConfig([string|null $option = null ]) : mixed

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
$option : string|null = null

The config option to retrieve.

Return values
mixed

request()

Create and send an HTTP request.

public 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 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

Search results