public function request(string $method, string $uri, $body, array $headers = [], array $options = []) {
        $request = $this->createRequest($method, $uri, $body, $headers, $options);
        // Call the chain of middleware on the request.
        $response = call_user_func($this->middleware, $request);

        if (!$response->isResponseClass('2xx')) {
            $this->handleErrorResponse($response, $options);
        }

        return $response;
    }
public function request(string $method, string $uri, $body, array $headers = [], array $options = []) {
        $request = $this->createRequest($method, $uri, $body, $headers, $options);
        // Call the chain of middleware on the request.
        $response = call_user_func($this->middleware, $request);

        if (!$response->isResponseClass('2xx')) {
            $this->handleErrorResponse($response, $options);
        }

        return $response;
    }
public function request ( string $ method , string $ uri , $ body , array $ headers = [ ] , array $ options = [ ] ) { $ request = $ this -> createRequest ( $ method , $ uri , $ body , $ headers , $ options ) ; // Call the chain of middleware on the request. $ response = call_user_func ( $ this -> middleware , $ request ) ; if ( ! $ response -> isResponseClass ( '2xx' ) ) { $ this -> handleErrorResponse ( $ response , $ options ) ; } return $ response ; }
Make a generic HTTP request against the API.

@param string $method The HTTP method of the request.
@param string $uri The URL or path of the request.
@param array|string $body The HTTP body to send to the request or an array to be appropriately encoded.
@param array $headers The HTTP headers to add to the request.
@param array $options An array of additional options for the request.
@return HttpResponse Returns the {@link HttpResponse} object from the call.
Make a generic HTTP request against the API .