diff --git a/src/Http/Senders/GuzzleSender.php b/src/Http/Senders/GuzzleSender.php index 2eadb703..a03148c7 100644 --- a/src/Http/Senders/GuzzleSender.php +++ b/src/Http/Senders/GuzzleSender.php @@ -66,11 +66,7 @@ public function getFactoryCollection(): FactoryCollection */ protected function createGuzzleClient(): GuzzleClient { - // We'll use HandlerStack::create as it will create a default - // handler stack with the default Guzzle middleware like - // http_errors, cookies etc. - - $this->handlerStack = HandlerStack::create(); + $this->handlerStack = $this->defaultHandlerStack(); // Now we'll return new Guzzle client with some default request // options configured. We'll also define the handler stack we @@ -86,6 +82,18 @@ protected function createGuzzleClient(): GuzzleClient ]); } + /** + * The default handler stack used by the underlying Guzzle client + */ + protected function defaultHandlerStack(): HandlerStack + { + // We'll use HandlerStack::create as it will create a default + // handler stack with the default Guzzle middleware like + // http_errors, cookies etc. + + return HandlerStack::create(); + } + /** * Send a synchronous request. *