diff --git a/src/Plugin/migrate_plus/data_fetcher/Http.php b/src/Plugin/migrate_plus/data_fetcher/Http.php index d8835a0a8996896c4a642dbf191435d6f74a54c9..b170cb22a7ad6195c4db60e7ddcd41dc2e0bcd9f 100755 --- a/src/Plugin/migrate_plus/data_fetcher/Http.php +++ b/src/Plugin/migrate_plus/data_fetcher/Http.php @@ -61,6 +61,9 @@ class Http extends DataFetcherPluginBase implements ContainerFactoryPluginInterf // Ensure there is a 'headers' key in the configuration. $configuration += ['headers' => []]; $this->setRequestHeaders($configuration['headers']); + // Set GET request-method by default. + $configuration += ['method' => 'GET']; + $this->configuration['method'] = $configuration['method']; } /** @@ -101,7 +104,8 @@ class Http extends DataFetcherPluginBase implements ContainerFactoryPluginInterf if (!empty($this->configuration['request_options'])) { $options = NestedArray::mergeDeep($options, $this->configuration['request_options']); } - $response = $this->httpClient->get($url, $options); + $method = $this->configuration['method'] ?? 'GET'; + $response = $this->httpClient->request($method, $url, $options); if (empty($response)) { throw new MigrateException('No response at ' . $url . '.'); }