GuzzleClient
- class Firstred\PostNL\HttpClient\GuzzleClient
- Class GuzzleClient.
- Parent:
- Implements:
Firstred\PostNL\HttpClient\ClientInterfacePsr\Log\LoggerAwareInterface
Summary
Methods
Constants
- DEFAULT_TIMEOUT = 60
- DEFAULT_CONNECT_TIMEOUT = 20
Properties
- protected property Firstred\PostNL\HttpClient\GuzzleClient::$instance
- Type:
static
- protected static property Firstred\PostNL\HttpClient\GuzzleClient::$defaultOptions
- Type:
array
- private static property Firstred\PostNL\HttpClient\GuzzleClient::$client
- Type:
\GuzzleHttp\Client
Methods
- public Firstred\PostNL\HttpClient\GuzzleClient::__construct($client=null, $logger=null, $concurrency=5, $maxRetries=5)
- GuzzleClient constructor.
- Parameters:
$client (
GuzzleHttp\Client| null)$logger (
Psr\Log\LoggerInterface| null)$concurrency (int)
$maxRetries (int)
- Since:
1.3.0 Custom constructor
- private Firstred\PostNL\HttpClient\GuzzleClient::setClient($client)
- private Firstred\PostNL\HttpClient\GuzzleClient::getClient()
- Get the Guzzle client.
- Returns:
\GuzzleHttp\Client
- public static Firstred\PostNL\HttpClient\GuzzleClient::getInstance()
- Returns:
- Deprecated:
Please instantiate a new client rather than using this singleton
- public Firstred\PostNL\HttpClient\GuzzleClient::setOption($name, $value)
- Set Guzzle option.
- Parameters:
$name (string)
$value (mixed)
- Returns:
- public Firstred\PostNL\HttpClient\GuzzleClient::getOption($name)
- Get Guzzle option.
- Parameters:
$name (string)
- Returns:
mixed | null
- public Firstred\PostNL\HttpClient\GuzzleClient::doRequest($request)
- Do a single request.Exceptions are captured into the result array
- Parameters:
$request (
Psr\Http\Message\RequestInterface)
- Returns:
\Psr\Http\Message\ResponseInterface- Throws:
- public Firstred\PostNL\HttpClient\GuzzleClient::doRequests( $requests=\[\])
- Do all async requests.Exceptions are captured into the result array
- Parameters:
$requests (
Psr\Http\Message\RequestInterface[])
- Returns:
\Firstred\PostNL\Exception\HttpClientException[]|\Psr\Http\Message\ResponseInterface[]- Throws: