src/Feature/Client/HttpClient.php
public function send(Request $request, $async = false): \Psr\Http\Message\StreamInterface
    {
        $this->currentUri = $request->fullUrl();
        $options = [];

        if ($request->method() === 'POST' || $request->method() === 'PUT') {
            $options['json'] = $request->request->all();
        }

        $client = new Client();
        $requestType = $async ? 'requestAsync' : 'request';

        $response = $client->{$requestType}($request->method(), $this->currentUri, $options);

        return $response->getBody();
    }
public function send(Request $request, $async = false): \Psr\Http\Message\StreamInterface
    {
        $this->currentUri = $request->fullUrl();
        $options = [];

        if ($request->method() === 'POST' || $request->method() === 'PUT') {
            $options['json'] = $request->request->all();
        }

        $client = new Client();
        $requestType = $async ? 'requestAsync' : 'request';

        $response = $client->{$requestType}($request->method(), $this->currentUri, $options);

        return $response->getBody();
    }
public function send ( Request $ request , $ async = false ) : \ Psr \ Http \ Message \ StreamInterface { $ this -> currentUri = $ request -> fullUrl ( ) ; $ options = [ ] ; if ( $ request -> method ( ) === 'POST' || $ request -> method ( ) === 'PUT' ) { $ options [ 'json' ] = $ request -> request -> all ( ) ; } $ client = new Client ( ) ; $ requestType = $ async ? 'requestAsync' : 'request' ; $ response = $ client -> { $ requestType } ( $ request -> method ( ) , $ this -> currentUri , $ options ) ; return $ response -> getBody ( ) ; }
Send the given request through the application.
This method allows you to fully customize the entire Request object.

@param Request $request
@param bool $async

@return \Psr\Http\Message\StreamInterface
Send the given request through the application . This method allows you to fully customize the entire Request object .