Unverified Commit 8f6fd2a7 authored by heddn's avatar heddn
Browse files

Fixes #257 by add request options

parent 0a1f9752
......@@ -9,6 +9,9 @@ source:
plugin: url
data_fetcher_plugin: http
data_parser_plugin: xml
# Guzzle request options can be added.
allow_redirects: false
# Normally, this is one or more fully-qualified URLs or file paths. Because
# we can't hardcode your local URL, we provide a relative path here which
# hook_install() will rewrite to a full URL for the current site.
......@@ -99,6 +99,9 @@ class Http extends DataFetcherPluginBase implements ContainerFactoryPluginInterf
if (!empty($this->configuration['authentication'])) {
$options = array_merge($options, $this->getAuthenticationPlugin()->getAuthenticationOptions());
if (!empty($this->configuration['request_options'])) {
$options = array_merge($options, $this->configuration['request_options']);
$response = $this->httpClient->get($url, $options);
if (empty($response)) {
throw new MigrateException('No response at ' . $url . '.');
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment