public function sendRequest($method = 'GET', $endPoint = '')
    {
        $options = array_filter([
            'query'   => $this->getQuery(),
            'headers' => $this->getHeaders(),
            'body'    => $this->getBody()
        ]);
        $url = $this->url . $endPoint;

        $request     = $this->request->createRequest($method, $url, $options);
        $rawResponse = $this->request->send($request);

        return $this->newResponse($rawResponse);

    }
public function sendRequest($method = 'GET', $endPoint = '')
    {
        $options = array_filter([
            'query'   => $this->getQuery(),
            'headers' => $this->getHeaders(),
            'body'    => $this->getBody()
        ]);
        $url = $this->url . $endPoint;

        $request     = $this->request->createRequest($method, $url, $options);
        $rawResponse = $this->request->send($request);

        return $this->newResponse($rawResponse);

    }
public function sendRequest ( $ method = 'GET' , $ endPoint = '' ) { $ options = array_filter ( [ 'query' => $ this -> getQuery ( ) , 'headers' => $ this -> getHeaders ( ) , 'body' => $ this -> getBody ( ) ] ) ; $ url = $ this -> url . $ endPoint ; $ request = $ this -> request -> createRequest ( $ method , $ url , $ options ) ; $ rawResponse = $ this -> request -> send ( $ request ) ; return $ this -> newResponse ( $ rawResponse ) ; }
Gets the request options, creates the request, sends it and returns new response object.

@param  string $method
@param  string $endPoint
@return \RestGalleries\Http\Guzzle\GuzzleResponse
Gets the request options creates the request sends it and returns new response object .