You are here

private function Client::transfer in Auth0 Single Sign On 8.2

Transfers the given request and applies request options.

The URI of the request is not modified and the request options are used as-is without merging in default options.

Parameters

array $options See \GuzzleHttp\RequestOptions.:

Return value

Promise\PromiseInterface

2 calls to Client::transfer()
Client::requestAsync in vendor/guzzlehttp/guzzle/src/Client.php
Create and send an asynchronous HTTP request.
Client::sendAsync in vendor/guzzlehttp/guzzle/src/Client.php
Asynchronously send an HTTP request.

File

vendor/guzzlehttp/guzzle/src/Client.php, line 332

Class

Client
@method ResponseInterface get(string|UriInterface $uri, array $options = []) @method ResponseInterface head(string|UriInterface $uri, array $options = []) @method ResponseInterface put(string|UriInterface $uri, array $options = []) @method…

Namespace

GuzzleHttp

Code

private function transfer(RequestInterface $request, array $options) {

  // save_to -> sink
  if (isset($options['save_to'])) {
    $options['sink'] = $options['save_to'];
    unset($options['save_to']);
  }

  // exceptions -> http_errors
  if (isset($options['exceptions'])) {
    $options['http_errors'] = $options['exceptions'];
    unset($options['exceptions']);
  }
  $request = $this
    ->applyOptions($request, $options);

  /** @var HandlerStack $handler */
  $handler = $options['handler'];
  try {
    return Promise\promise_for($handler($request, $options));
  } catch (\Exception $e) {
    return Promise\rejection_for($e);
  }
}