class WebformTestHandlerRemotePostClientFactory in Webform 6.x
Same name and namespace in other branches
- 8.5 tests/modules/webform_test_handler_remote_post/src/WebformTestHandlerRemotePostClientFactory.php \Drupal\webform_test_handler_remote_post\WebformTestHandlerRemotePostClientFactory
Extend Drupal client so that we can override Guzzel client.
Hierarchy
- class \Drupal\Core\Http\ClientFactory
- class \Drupal\webform_test_handler_remote_post\WebformTestHandlerRemotePostClientFactory
Expanded class hierarchy of WebformTestHandlerRemotePostClientFactory
See also
\Drupal\Core\Http\ClientFactory::fromOptions
File
- tests/
modules/ webform_test_handler_remote_post/ src/ WebformTestHandlerRemotePostClientFactory.php, line 14
Namespace
Drupal\webform_test_handler_remote_postView source
class WebformTestHandlerRemotePostClientFactory extends ClientFactory {
/**
* {@inheritdoc}
*/
public function fromOptions(array $config = []) {
$default_config = [
'verify' => TRUE,
'timeout' => 30,
'headers' => [
'User-Agent' => 'Drupal/' . \Drupal::VERSION . ' (+https://www.drupal.org/) ' . \GuzzleHttp\default_user_agent(),
],
'handler' => $this->stack,
'proxy' => [
'http' => NULL,
'https' => NULL,
'no' => [],
],
];
$config = NestedArray::mergeDeep($default_config, Settings::get('http_client_config', []), $config);
return new WebformTestHandlerRemotePostClient($config);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ClientFactory:: |
protected | property | The handler stack. | |
ClientFactory:: |
public | function | Constructs a new ClientFactory instance. | |
WebformTestHandlerRemotePostClientFactory:: |
public | function |
Constructs a new client object from some configuration. Overrides ClientFactory:: |