diff --git a/src/GuzzleHttpProvider.php b/src/GuzzleHttpProvider.php index 4fae174..d542901 100644 --- a/src/GuzzleHttpProvider.php +++ b/src/GuzzleHttpProvider.php @@ -24,10 +24,12 @@ class GuzzleHttpProvider implements IHttpProvider /** * Creates a new HttpProvider + * + * @param array $config */ - public function __construct() + public function __construct($config = []) { - $this->http = new Client(); + $this->http = new Client($config); $this->timeout = 0; $this->extra_options = array(); } @@ -54,6 +56,16 @@ public function setTimeout($timeout) return $this; } + /** + * Configures the default options for the client. + * + * @param array $config + */ + public function configureDefaults($config) + { + $this->http->configureDefaults($config); + } + public function setExtraOptions($options) { $this->extra_options = $options;