DEFAULT_TIMEOUT
DEFAULT_TIMEOUT = 120
Seconds a single request may take before it is abandoned.
Carries one provider request to an endpoint over the HTTP client Drupal already ships.
Every remote provider takes its transport as a callable, so the whole provider is exercised against canned responses with no network and no credentials. This is the one that talks to a real endpoint.
A 4xx or 5xx is a normal answer here, not an exception: the provider reads the status itself and decides what it means, since a 404 from a head is absence while a 404 from a get is an error. The client's own exceptions are therefore unwrapped back into a status where they carry a response, and only a genuine transport failure - a refused connection, a timeout, a DNS failure - surfaces as a status of 0 with the reason in the body.
__construct(\GuzzleHttp\ClientInterface $client, int $timeout = \self::DEFAULT_TIMEOUT, int $connectTimeout = \self::DEFAULT_CONNECT_TIMEOUT) : mixed
Constructs a transport.
| \GuzzleHttp\ClientInterface | $client | The HTTP client. |
| int | $timeout | Seconds a request may take. |
| int | $connectTimeout | Seconds to wait for a connection. |
__invoke(string $method, string $url, array$headers = [], string|null $body = null) : array{status: int, body: string, headers: array<string,string>}
Sends one request.
| string | $method | HTTP method. |
| string | $url | Absolute URL. |
| array |
$headers | Headers, including whatever authorization the caller produced. |
| string|null | $body | Request body, or NULL. |
The response. A status of 0 means the request never reached the endpoint.