TraceableHttpClient
in package
implements
HttpClientInterface, ResetInterface
Tags
Interfaces, Classes, Traits and Enums
- HttpClientInterface
- Provides flexible methods for requesting HTTP resources synchronously or asynchronously.
- ResetInterface
- Provides a way to reset an object to its initial state.
Table of Contents
- $client : mixed
- $tracedRequests : mixed
- __construct() : mixed
- getTracedRequests() : array<string|int, mixed>
- request() : ResponseInterface
- Requests an HTTP resource.
- reset() : mixed
- stream() : ResponseStreamInterface
- Yields responses chunk by chunk as they complete.
Properties
$client
private
mixed
$client
$tracedRequests
private
mixed
$tracedRequests
= []
Methods
__construct()
public
__construct(HttpClientInterface $client) : mixed
Parameters
- $client : HttpClientInterface
Return values
mixed —getTracedRequests()
public
getTracedRequests() : array<string|int, mixed>
Return values
array<string|int, mixed> —request()
Requests an HTTP resource.
public
request(string $method, string $url[, array<string|int, mixed> $options = [] ]) : ResponseInterface
Parameters
- $method : string
- $url : string
- $options : array<string|int, mixed> = []
Return values
ResponseInterface —reset()
public
reset() : mixed
Return values
mixed —stream()
Yields responses chunk by chunk as they complete.
public
stream(mixed $responses[, float $timeout = null ]) : ResponseStreamInterface
Parameters
- $responses : mixed
-
One or more responses created by the current HTTP client
- $timeout : float = null
-
The idle timeout before yielding timeout chunks