src/VK/TransportClient/Curl/CurlHttpClient.php
public function sendRequest(string $url, array $opts) {
        $curl = curl_init($url);

        curl_setopt_array($curl, $this->initial_opts + $opts);

        $response = curl_exec($curl);

        $curl_error_code = curl_errno($curl);
        $curl_error = curl_error($curl);
      
        $http_status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
        curl_close($curl);
        
        if ($curl_error || $curl_error_code) {
            $error_msg = "Failed curl request. Curl error {$curl_error_code}";
            if ($curl_error) {
                $error_msg .= ": {$curl_error}";
            }

            $error_msg .= '.';

            throw new TransportRequestException($error_msg);
        }

        return $this->parseRawResponse($http_status, $response);
    }
public function sendRequest(string $url, array $opts) {
        $curl = curl_init($url);

        curl_setopt_array($curl, $this->initial_opts + $opts);

        $response = curl_exec($curl);

        $curl_error_code = curl_errno($curl);
        $curl_error = curl_error($curl);
      
        $http_status = curl_getinfo($curl, CURLINFO_RESPONSE_CODE);
        curl_close($curl);
        
        if ($curl_error || $curl_error_code) {
            $error_msg = "Failed curl request. Curl error {$curl_error_code}";
            if ($curl_error) {
                $error_msg .= ": {$curl_error}";
            }

            $error_msg .= '.';

            throw new TransportRequestException($error_msg);
        }

        return $this->parseRawResponse($http_status, $response);
    }
public function sendRequest ( string $ url , array $ opts ) { $ curl = curl_init ( $ url ) ; curl_setopt_array ( $ curl , $ this -> initial_opts + $ opts ) ; $ response = curl_exec ( $ curl ) ; $ curl_error_code = curl_errno ( $ curl ) ; $ curl_error = curl_error ( $ curl ) ; $ http_status = curl_getinfo ( $ curl , CURLINFO_RESPONSE_CODE ) ; curl_close ( $ curl ) ; if ( $ curl_error || $ curl_error_code ) { $ error_msg = "Failed curl request. Curl error {$curl_error_code}" ; if ( $ curl_error ) { $ error_msg .= ": {$curl_error}" ; } $ error_msg .= '.' ; throw new TransportRequestException ( $ error_msg ) ; } return $ this -> parseRawResponse ( $ http_status , $ response ) ; }
Makes and sends request.

@param string $url
@param array $opts

@return TransportClientResponse
@throws TransportRequestException
Makes and sends request .