Documentation

GuzzleHttpClient
in package
implements HttpClientInterface

An HTTP client that uses Guzzle to send requests.

Table of Contents

Interfaces

HttpClientInterface

Properties

$guzzleClient  : Client

Methods

__construct()  : mixed
post()  : string
Sends a POST request to the specified URL with the given data.
uploadFile()  : string
Sends a multipart/form-data request to the specified URL with the given data.
handleRequestException()  : string
Extracts a meaningful error response from a RequestException.

Properties

Methods

__construct()

public __construct([int $timeout = 60 ][, bool $verifySSL = true ]) : mixed
Parameters
$timeout : int = 60
$verifySSL : bool = true

post()

Sends a POST request to the specified URL with the given data.

public post(string $url, string $body[, array<string|int, mixed> $headers = [] ]) : string
Parameters
$url : string

The full URL for the request

$body : string
$headers : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

uploadFile()

Sends a multipart/form-data request to the specified URL with the given data.

public uploadFile(string $url, array<string|int, mixed> $multipart[, array<string|int, mixed> $headers = [] ]) : string
Parameters
$url : string
$multipart : array<string|int, mixed>
$headers : array<string|int, mixed> = []
Tags
throws
Exception
Return values
string

handleRequestException()

Extracts a meaningful error response from a RequestException.

private handleRequestException(RequestException $e) : string
Parameters
$e : RequestException
Return values
string
On this page

Search results