final public function Client::setConfig

Set the configuration object to use with the client

Parameters

array|Collection|string $config Parameters that define how the client behaves and connects to a: webservice. Pass an array or a Collection object.

Return value

ClientInterface

Overrides ClientInterface::setConfig

1 call to Client::setConfig()
Client::__construct in drupal/core/vendor/guzzle/http/Guzzle/Http/Client.php
Client constructor

File

drupal/core/vendor/guzzle/http/Guzzle/Http/Client.php, line 97

Class

Client
HTTP client

Namespace

Guzzle\Http

Code

public final function setConfig($config) {

  // Set the configuration object
  if ($config instanceof Collection) {
    $this->config = $config;
  }
  elseif (is_array($config)) {
    $this->config = new Collection($config);
  }
  else {
    throw new InvalidArgumentException('Config must be an array or Collection');
  }
  return $this;
}