@param  HttpRequestInterface  $request
@param  HttpResponseInterface $response
@param  array                 $options

@return HttpResponseInterface
329272
public function applyResponse(HttpRequestInterface $request, HttpResponseInterface $response, array $options)
    {
        return $this->factory->fromResponse($response);
    }
159773
protected function respond($response, $request, $options, $statusCode)
    {
        if (array_key_exists('webhooks', $response)) {
            $results = [];
            foreach ($response['webhooks'] as $result) {
                $results[] = $this->mapResponse($result, $statusCode);
            }

            return $results;
        }

        // IPN response
        if (in_array(Arr::get($response, 'body'), ['VERIFIED', 'INVALID'])) {
            $response = array_merge($request, $response);
        }
        // charge request
        elseif (array_key_exists('continue_url', $options)) {
            $response['continue_url'] = $options['continue_url'];
            $response['is_redirect'] = true;
        }

        return $this->mapResponse($response, $statusCode);
    }
464612
public function render(Request $request, array $options = array())
    {
        $provider = isset($options['provider']) ? $this->getProvider($options['provider']) : $this->getDefaultProvider();
        unset($options['provider']);

        return $provider->render($request, $options);
    }
12976
private function _request($method, $url, array $options) {
		try {
			$response = $this->httpClient->{$method}($url, $options);
		} catch(ClientException $e) {
			$response = $e->getResponse();
		} catch(ConnectException $e) {
			$this->_throwServerError($e);
		} catch (RequestException $e) {
			$this->_throwServerError($e);
		}

		return $response;
	}
781881
public function request($requestParams, $url, $method, $requiredParams, $options)
    {
        $client = $this->getHttpClient();
        $url = $this->buildEndpoint($url);

        return $client->httpRequest($requestParams, $url, $method, $requiredParams, $options);
    }
835945
public function getRequestWithOptions($method, $uri, array $options = [])
    {
        $options = $this->parseOptions($options);

        return $this->getRequest(
            $method,
            $uri,
            $options['headers'],
            $options['body'],
            $options['version']
        );
    }
415966
public function send(IHttpClientOptions $options, IHttpRequest $httpRequest) {
        $requestBuilder = new RequestBuilder($httpRequest, $options);
        $responseBuilder = $requestBuilder->send();
        $httpResponse = $responseBuilder->createResponse();
        $requestBuilder->close();

        return $httpResponse;
    }
405525
public function checkRedirect(
        RequestInterface $request,
        array $options,
        ResponseInterface $response
    ) {
        if (substr($response->getStatusCode(), 0, 1) != '3'
            || !$response->hasHeader('Location')
        ) {
            return $response;
        }

        $this->guardMax($request, $options);
        $nextRequest = $this->modifyRequest($request, $options, $response);

        if (isset($options['allow_redirects']['on_redirect'])) {
            call_user_func(
                $options['allow_redirects']['on_redirect'],
                $request,
                $response,
                $nextRequest->getUri()
            );
        }

        /** @var PromiseInterface|ResponseInterface $promise */
        $promise = $this($nextRequest, $options);

        // Add headers to be able to track history of redirects.
        if (!empty($options['allow_redirects']['track_redirects'])) {
            return $this->withTracking(
                $promise,
                (string) $nextRequest->getUri(),
                $response->getStatusCode()
            );
        }

        return $promise;
    }
917006
public function request($method, $uri = null, array $options = [])
    {
        return $this->doRequest($method, $uri, $options);
    }
549789
public function sendRequest($request, $options = [])
    {
        $client = $this->client;
        $response = $client->send($request, $options);

        return $response;
    }
1186678
public function send(RequestInterface $request, array $options = [])
    {
        $options = array_merge($options, ['http_errors' => false]);

        $psr7Response = $this->guzzle->send($request, $options);

        if ($psr7Response->getStatusCode() === 400) {
            $responseArray = \GuzzleHttp\json_decode($psr7Response->getBody(), true);
            throw new AffilinetProductWebserviceException($responseArray['ErrorMessages'][0]['Value']);
        }

        return $psr7Response;
    }
39511
public function setHeader(HeaderElementInterface $header, $options = array())
    {
        $this->listColumn->setHeader($header, $options);
        return $this;
    }
667809
private function performRequest($method, $url, $options) {

        try {
            switch ($method) {
                case 'GET':
                    return json_decode($this->client->get($url, $options)->getBody(), true);
                case 'POST':
                    return json_decode($this->client->post($url, $options)->getBody(), true);
                case 'PUT':
                    return json_decode($this->client->put($url, $options)->getBody(), true);
                case 'DELETE':
                    return json_decode($this->client->delete($url, $options)->getBody(), true);
                default:
                    return null;
            }
        } catch (RequestException $e) {
            throw ApiException::create($e);
        }
    }
1092411
public function post(
        ResponseInterface $response,
        string $transactionId,
        array $options = []
    ): CancellablePromiseInterface {
        if ($response->getBody() instanceof ReadableStreamInterface) {
            return resolve($response);
        }

        if (!isset($options[self::class]) &&
        strpos($response->getHeaderLine('Content-Type'), 'text/xml') !== 0) {
            return resolve($response);
        }

        if (isset($options[self::class][Options::CONTENT_TYPE]) &&
        $response->getHeaderLine('Content-Type') !== $options[self::class][Options::CONTENT_TYPE]) {
            return resolve($response);
        }

        $body = (string)$response->getBody();
        if ($body === '') {
            $stream = new BufferStream(0);
            $stream->write($body);

            return resolve($response->withBody($stream));
        }

        return $this->xmlDecodeService->decode($body)->then(function (array $xml) use ($response) {
            return resolve($response->withBody(new XmlStream($xml)));
        });
    }
324756
public function send(RequestInterface $request, array $options = [])
    {
        try {
            return $this->client->send($request, $options);
        } catch (TransferException $e) {
            throw new TransportException($e->getMessage(), $e->getCode(), $e);
        }
    }
1249794
public function getRequest($method, $url, array $options = [])
    {
        return $this->createRequest($method, $url, null, $options);
    }
780446
public function createRequest($method, $url, array $options = [])
    {
        $headers = isset($options['headers']) ? $options['headers'] : [];

        $body = isset($options['body']) ? $options['body'] : null;

        return new Request($method, $url, $headers, $body);
    }