{@inheritdoc}

@see OAuthClientInterface::retrieveResponse()
549764
public function retrieveResponse(OAuthUriInterface $endpoint, $requestBody, array $extraHeaders = [], $method = 'POST')
    {
        $request = new Request();
        $request
            ->setUri($endpoint->getAbsoluteUri())
            ->setMethod($method)
            ->getHeaders()->addHeaders($extraHeaders);
        if (is_array($requestBody)) {
            $request->getPost()->fromArray($requestBody);
        } else {
            $request->setContent($requestBody);
        }
        $response = $this->client->send($request);

        return $response->getBody();
    }
112937
protected function getResponse(array $headers, $body)
    {
        // Create the response object.
        $return = new Response();

        // Set the body for the response.
        $return->getBody()->write($body);

        $return->getBody()->rewind();

        // Get the response code from the first offset of the response headers.
        preg_match('/[0-9]{3}/', array_shift($headers), $matches);
        $code = $matches[0];

        if (is_numeric($code)) {
            $return = $return->withStatus($code);
        } elseif (!$this->getOption('allow_empty_status_code', false)) {
            // No valid response code was detected.
            throw new \UnexpectedValueException('No HTTP response code found.');
        }
        // Add the response headers to the response object.
        foreach ($headers as $header) {
            $pos = strpos($header, ':');

            $return = $return->withHeader(trim(substr($header, 0, $pos)), trim(substr($header, ($pos + 1))));
        }

        return $return;
    }
227143
public function getTokenResponse()
    {
        $query = [
            'grant_type' => 'client_credential',
            'appid' => $this['appid'],
            'secret' => $this['appsecret'],
        ];

        $response = Http::request('GET', static::ACCESS_TOKEN)
            ->withQuery($query)
            ->send();

        if ($response->containsKey('errcode')) {
            throw new \Exception($response['errmsg'], $response['errcode']);
        }

        return $response;
    }
960739
protected function getResponse()
    {
        try {
            $response = $this->client->getInternalResponse();
        } catch (BadMethodCallException $e) {
            // Handling Symfony 5+ behaviour
            $response = null;
        }

        if (null === $response) {
            throw new DriverException('Unable to access the response before visiting a page');
        }

        return $response;
    }
1287097
function getResponsabilidadIva($id = 0){
        if($id == 0){
         $id = $this->id;
        }
        $ret = $this->find('first',array('conditions'=>array('Cliente.id'=>$id),'contain'=>array('IvaResponsabilidad')));
        return $ret;
    }
922056
public static function retrieve($uuid, ClientInterface $client = null)
    {
        return (new RequestService($client))
            ->setResourceClass(static::class)
            ->get($uuid);
    }
1229849
static function _httpResponseToMessage($response)
    {
        // Should this function be named Message.fromHTTPResponse instead?
        $response_message = Auth_OpenID_Message::fromKVForm($response->body);

        if ($response->status == 400) {
            return Auth_OpenID_ServerErrorContainer::fromMessage(
                        $response_message);
        } else if ($response->status != 200 and $response->status != 206) {
            return null;
        }

        return $response_message;
    }
389819
public function getResponse(array $query = array())
    {
        $headers = $this->headers;
        $json = null;
        
        if ($this->json) {
            $json   = json_encode($query);
            $query  = array();
        }
        
        //get the authorization parameters as an array
        $signature = $this->getSignature($query);
        $authorization  = $this->getAuthorization($signature, false);
        
        //if we should use the authrization
        if ($this->useAuthorization) {
            //add the string to headers
            $headers[] = sprintf(self::AUTH_HEADER, $this->buildQuery($authorization, ',', false));
        } else {
            //merge authorization and query
            $query = array_merge($authorization, $query);
        }
        
        $query = $this->buildQuery($query);
        $url = $this->url;
        
        //set curl
        $curl = Curl::i()->verifyHost(false)->verifyPeer(false);
        
        //if post
        if ($this->method == self::POST) {
            $headers[] = self::POST_HEADER;
            
            if (!is_null($json)) {
                $query = $json;
            }
            
            //get the response
            $response = $curl->setUrl($url)
                ->setPost(true)
                ->setPostFields($query)
                ->setHeaders($headers)
                ->getResponse();
        } else {
            if (trim($query)) {
                //determine the conector
                $connector = null;
                
                //if there is no question mark
                if (strpos($url, '?') === false) {
                    $connector = '?';
                //if the redirect doesn't end with a question mark
                } else if (substr($url, -1) != '?') {
                    $connector = '&';
                }
                
                //now add the secret to the redirect
                $url .= $connector.$query;
            }
            
            //get the response
            $response = $curl->setUrl($url)->setHeaders($headers)->getResponse();
        }
        
        $this->meta = $curl->getMeta();
        $this->meta['url'] = $url;
        $this->meta['authorization'] = $authorization;
        $this->meta['headers'] = $headers;
        $this->meta['query'] = $query;
        $this->meta['response'] = $response;
        
        return $response;
    }
763681
public function retrieve($uri)
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $uri);
        curl_setopt($ch, CURLOPT_HEADER, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_HTTPHEADER, array('Accept: ' . Validator::SCHEMA_MEDIA_TYPE));

        $response = curl_exec($ch);
        if (false === $response) {
            throw new \JsonSchema\Exception\ResourceNotFoundException('JSON schema not found');
        }

        $this->fetchMessageBody($response);
        $this->fetchContentType($response);

        curl_close($ch);

        return $this->messageBody;
    }
968098
public function getResponse()
    {
        $obj = new \stdClass();
        $obj->ret = $this->ret;
        $obj->msg = $this->msg;
        $obj->data = $this->data;

        return json_encode($obj);
    }
985754
public function getAuthorizationResponse($data)
    {
        $this->makePaymentRequest($data);

        $this->url = $this->getResponse()['data']['authorization_url'];

        return $this->getResponse();
    }
1145810
private function getCachedResponse($method, $url, array $data, array $headers)
    {
        if ($this->cache)
        {
            return $this->cache->findResponse($method, $url, $data, $headers, $this->basicAuthCredentials);
        }

        return false;
    }
187222
protected function respond($response)
    {
        $success = Arr::get($response, 'success');

        return $this->mapResponse($success, $response);
    }
318079
private function getResponse($method, $path, $parameters)
    {
        try {
            $response = $this->adapter->request($method, $path, $parameters);
            return $this->getResult($response);
        }
        catch (\Exception $e) {
            return $e->getMessage();
        }
    }
852524
public function retrieveData($url)
    {
        if (!is_null($this->getAuthorizationToken())) {
            $this->curlWrapper->setHeader('Authorization', $this->getAuthorizationToken());
        }

        $this->retrieve($url);

        return $this->curlWrapper->response;
    }
1104315
public function getToken(string $login, string $pass): GetTokenResponse
    {
        $response = $this->request('GET', 'getToken', [
            'login' => $login,
            'pass' => $pass,
        ]);

        return $this->converter->getResponseObject(GetTokenResponse::class, $response);
    }
840999
public static function collectResponse(){
        self::init();
        $fb = self::$fbInstance;
        $helper = $fb->getRedirectLoginHelper();

        try {
            $accessToken = $helper->getAccessToken();
        } catch(FacebookResponseException $e) {
            echo 'Graph returned an error: ' . $e->getMessage();
            exit;
        } catch(FacebookSDKException $e) {
            echo 'Facebook SDK returned an error: ' . $e->getMessage();
            exit;
        }

        if (isset($accessToken)) {
            $oAuth2Client = $fb->getOAuth2Client();
            $longLivedAccessToken = $oAuth2Client->getLongLivedAccessToken($accessToken);
            Cookie::setItem("fb_token",$longLivedAccessToken);
            self::redirectToRedirectURL();
        }

    }