Skip to content

Commit

Permalink
Support configuring default options for Guzzle HTTP provider (#150)
Browse files Browse the repository at this point in the history
  • Loading branch information
krystalcode authored Mar 19, 2024
1 parent 77a80d9 commit 5987e57
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/GuzzleHttpProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand All @@ -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;
Expand Down

0 comments on commit 5987e57

Please sign in to comment.