sendRequest.

@param RequestContract $request
@return ResponseContract
430926
protected function sendRequest(RequestContract $request): ResponseContract
    {
        $this->app->instance('request', $this->bindRequestMatcher($request));

        Facade::clearResolvedInstance('request');

        return (new Pipeline($this->app))
            ->send($request)
            ->through(array_merge($this->middleware, $request->matcher()->getCallerMiddleware()))
            ->then(function (RequestContract $request) {
                return $this->toResponse(
                    $this->app->call($request->matcher()->getCallerUses())
                );
            });
    }
365821
public function send(Request $request)
    {
        $response   = new GetResponse();
        $rpbGetReq  = $this->createRpbMessage($request);
        $rpbGetResp = $this->client->send($rpbGetReq, RiakMessageCodes::GET_REQ, RiakMessageCodes::GET_RESP);

        if ( ! $rpbGetResp instanceof RpbGetResp) {
            return $response;
        }

        if ( ! $rpbGetResp->hasContent()) {
            return $response;
        }

        $response->vClock      = $rpbGetResp->getVclock()->get();
        $response->contentList = $this->createContentList($rpbGetResp->getContentList());

        return $response;
    }
673846
protected function sendRequestThroughRouter(Request $request)
    {
        return (new Pipeline($this->app))->send($request)->then(function ($request) {

            /**
             * @var Response $response
             */
            $response = $this->router->dispatch($request);

            if (property_exists($response, 'exception') && $response->exception instanceof Exception) {
                throw $response->exception;
            }

            return $response;
        });
    }
464439
public function send(Request $request)
    {
        $response     = new PutSchemaResponse();
        $httpRequest  = $this->createHttpRequest($request);

        $this->client->send($httpRequest);

        return $response;
    }
1275205
public function send(AbstractRequest $request)
    {
        $handle = HandleFactory::build($request);
        $this->dispatch(MessageEvent::REQUEST, new MessageEvent($request));

        try {
            $result = $handle->execute();
        } catch (\Exception $error) {
            if ($error instanceof CurlException) {
                $response = ResponseFactory::build('', $handle->infos(), $request);
                $error->setResponse($response);
            }
            $this->dispatch(ErrorEvent::ERROR, new ErrorEvent($error));
            throw $error;
        }

        $response = ResponseFactory::build($result, $handle->infos(), $request);
        $this->dispatch(MessageEvent::RESPONSE, new MessageEvent($response));

        return $response;
    }
387176
protected function send(Request $request)
    {
        $request = $this->auth->addCredentialsToRequest($request);

        return $request->send()->json();
    }
211661
public function handle(Request $request) : Response
    {
        try {
            return $this->handleRequest($request);
        } catch (HttpException $e) {
            return $this->handleHttpException($e, $request);
        } catch (\Throwable $e) {
            return $this->handleUncaughtException($e, $request);
        }
    }
744540
protected function sendRequest(Request $request)
    {
        $curl = curl_init($this->getUrl($request));

        curl_setopt_array($curl, $this->curlOptions);
        curl_setopt($curl, CURLOPT_POSTFIELDS, http_build_query($request->getRequestFields()));

        $response = curl_exec($curl);

        if(curl_errno($curl))
        {
            $error_message  = 'Error occurred: ' . curl_error($curl);
            $error_code     = curl_errno($curl);
        }
        elseif(curl_getinfo($curl, CURLINFO_HTTP_CODE) != 200)
        {
            $error_code     = curl_getinfo($curl, CURLINFO_HTTP_CODE);
            $error_message  = "Error occurred. HTTP code: '{$error_code}'";
        }

        curl_close($curl);

        if (!empty($error_message))
        {
            throw new RequestException($error_message, $error_code);
        }
        else
        {
            return $response;
        }
    }
1285830
public function send(Request $request)
    {
        $response    = new GetResponse();
        $httpRequest = $this->createHttpRequest($request);

        try {
            $httpResponse = $this->client->send($httpRequest);
            $code         = $httpResponse->getStatusCode();
        } catch (RequestException $e) {
            if ($e->getCode() == 404 && $request->notfoundOk) {
                return $response;
            }

            throw $e;
        }

        if ( ! isset($this->validResponseCodes[$code])) {
            throw RiakTransportException::unexpectedStatusCode($code);
        }

        $json    = $httpResponse->json();
        $context = isset($json['context']) ? $json['context'] : null;
        $value   = $json['value'];
        $type    = $json['type'];

        $response->type    = $type;
        $response->context = $context;
        $response->value   = $this->opConverter->fromArray($type, $value);

        return $response;
    }
79137
public function send(RequestInterface $request)
	{
		$response = parent::send($request);

		if ($response->getStatusCode() == 202)
		{
			if (($responseBody = json_decode($response->getBody(), true)) && isset($responseBody['href']))
			{
				$operation = new Uri($responseBody['href']);

				if ( ! $operation->getQuery())
				{
					$responseBody['operation'] = substr(strrchr($operation->getPath(), '/'), 1);
					$stream = new Stream('php://temp', 'w');
					$stream->write(json_encode($responseBody));
					$this->addOperation($responseBody['operation']);

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

		return $response;
	}
338436
public function send(Request $request)
    {
        $response    = new GetResponse();
        $rpbRequest  = $this->createRpbMessage($request);
        $rpbResponse = $this->client->send($rpbRequest, RiakMessageCodes::DT_FETCH_REQ, RiakMessageCodes::DT_FETCH_RESP);

        if ( ! $rpbResponse instanceof DtFetchResp) {
            return $response;
        }

        $dtType  = $rpbResponse->type;
        $dtValue = $rpbResponse->hasValue() ? $rpbResponse->value : null;

        if ($rpbResponse->hasContext()) {
            $response->context = $rpbResponse->context;
        }

        if ($dtValue == null) {
            return $response;
        }

        if (DataType::COUNTER == $dtType) {
            $response->value = $dtValue->counter_value;
            $response->type  = 'counter';
        }

        if (DataType::SET == $dtType) {
            $response->value = $dtValue->set_value;
            $response->type  = 'set';
        }

        if (DataType::MAP == $dtType) {
            $response->value = $this->opConverter->fromProtoBuf($dtValue->map_value);
            $response->type  = 'map';
        }

        return $response;
    }
845515
public function send(Request $request)
    {
        $rpbGetReq  = $this->createRpbMessage($request);
        $rpbGetResp = $this->client->send($rpbGetReq, RiakMessageCodes::GET_BUCKET_REQ, RiakMessageCodes::GET_BUCKET_RESP);
        $rpbProps   = $rpbGetResp->getProps();
        $response   = $this->createGetResponse($rpbProps);

        $response->name = $request->bucket;

        return $this->createGetResponse($rpbProps);
    }
625296
protected function sendRequest(RequestInterface $request): ResponseInterface
    {
        $data = $request->getData();

        $event = new SendPaymentRequestEvent([
            'requestData' => $data
        ]);

        // Raise 'beforeSendPaymentRequest' event
        $this->trigger(self::EVENT_BEFORE_SEND_PAYMENT_REQUEST, $event);

        // We can't merge the $data with $modifiedData since the $data is not always an array.
        // For example it could be a XML object, json, or anything else really.
        if ($event->modifiedRequestData !== null) {
            return $request->sendData($event->modifiedRequestData);
        }

        return $request->send();
    }
1145697
public function send(Request $request): Response
    {
        $this->serialInterface->send($request->encode());
        return $this->receiveResponse($request->getTimeout());
    }
1246983
public function send(Request $request)
    {
        $this->monitor->start($this->metricName, ['service_key' => $request->getServiceKey(), 'request_key' => $request->getRequestKey()]);
        $response = $this->sender->send($request);
        $this->monitor->end($this->metricName, ['response_status' => $response->getStatusCode()]);
        return $response;
    }
794242
public function send(Request $request)
    {
        $response  = new ListKeysResponse();
        $rpbGetReq = $this->createRpbMessage($request);
        $socket    = $this->client->emit($rpbGetReq, RiakMessageCodes::LIST_KEYS_REQ);
        $iterator  = new ProtoStreamIterator($this->client, $socket, RiakMessageCodes::LIST_KEYS_RESP);

        $response->iterator = new ProtoListKeysResponseIterator($iterator);

        return $response;
    }
32417
protected function sendRequest(RequestInterface $request)
    {
        try {
            $response = $this->httpClient->send(
                $request,
                $this->getRequestOptions()
            );

            $this->multipartResources = [];

            return json_decode($response->getBody());
        } catch (RequestException $e) {
            $this->throwRequestException($e);
        }
    }