Loading src/ClientBase.php +5 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\apitools; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Http\ClientFactory as HttpClient; use Drupal\Core\Plugin\PluginBase; use Drupal\Core\TempStore\SharedTempStore; Loading Loading @@ -128,10 +129,11 @@ abstract class ClientBase extends PluginBase implements ClientInterface { */ public function request($method, $path, $options = []) { $response = NULL; $path = $this->options->get('base_path') . '/' . $path; $this->options->add($options); $request_options = clone $this->options; $request_options->replace(NestedArray::mergeDeep($request_options->all(), $options)); $path = $request_options->get('base_path') . '/' . $path; try { $response = $this->httpClient->{$method}($path, $this->options->all()); $response = $this->httpClient->{$method}($path, $request_options->all()); $response = $response->getBody()->getContents(); } catch (\Exception $e) { Loading Loading
src/ClientBase.php +5 −3 Original line number Diff line number Diff line Loading @@ -2,6 +2,7 @@ namespace Drupal\apitools; use Drupal\Component\Utility\NestedArray; use Drupal\Core\Http\ClientFactory as HttpClient; use Drupal\Core\Plugin\PluginBase; use Drupal\Core\TempStore\SharedTempStore; Loading Loading @@ -128,10 +129,11 @@ abstract class ClientBase extends PluginBase implements ClientInterface { */ public function request($method, $path, $options = []) { $response = NULL; $path = $this->options->get('base_path') . '/' . $path; $this->options->add($options); $request_options = clone $this->options; $request_options->replace(NestedArray::mergeDeep($request_options->all(), $options)); $path = $request_options->get('base_path') . '/' . $path; try { $response = $this->httpClient->{$method}($path, $this->options->all()); $response = $this->httpClient->{$method}($path, $request_options->all()); $response = $response->getBody()->getContents(); } catch (\Exception $e) { Loading