@param $url
@param $data
@param array $headers

@return bool
502965
protected function request($url, $data, array $headers = array())
    {
        $ch = curl_init();

        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));

        curl_exec($ch);
        $statusCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
        curl_close($ch);

        return floor($statusCode / 100) == 2;
    }
19781
public function create(array $data, array $headers = [])
    {
        $url = $this->url('invoices');

        return $this->post($url, $data, $headers);
    }
99127
public function post($url, $data = array()) 
    {
        if(!$this->sendRequest($url, $data, 'POST')) {
            return false;
        }
        
        if($this->rspStatus != 200) {
            return false;
        }
        
        return $this->rspBody;
    }
925357
public function put($url, $data = '', array $headers = [])
    {
        return $this->executor->execute(
            $url,
            [
                CURLOPT_CUSTOMREQUEST  => 'PUT',
                CURLOPT_HTTPHEADER => $headers,
                CURLOPT_POSTFIELDS => $data,
            ]
        );
    }
632214
public function postStream($url, $data, $files = [], $header = [])
    {
        if (!is_array($files)) {
            $file = $files;
            $files = ['file' => $file];
        }
        foreach ($files as $key => $item) {
            if ($streamData = FileUtil::readStream($item)) {
                $data["{$key}\";filename=\"{$key}"] = $streamData;
            }
        }
        return $this->exec($url, $data, 'post', $header);
    }
15446
public function put($url, $data = [], $headers = [], $curl_opts = []) {
        $curl_opts[CURLOPT_CUSTOMREQUEST] = 'PUT';
        return $this->load($url, $data, $headers, $curl_opts);
    }
456082
public function connect($url, $headers = [], $parameters = null)
    {
        return $this->send(Method::CONNECT, $url, $parameters, $headers);
    }
546568
public function copy(array $data, array $headers = [])
    {
        $url = $this->url('addons/copy');

        return $this->post($url, $data, $headers);
    }
780396
public function response(array $data, array $headers = [])
    {
        $response = $this->response;
        $response->setJsonContent($data, JSON_UNESCAPED_UNICODE);
        $response->setStatusCode($this->getStatusCode());
        foreach ($headers as $name => $value) {
            $response->setHeader($name, $value);
        }

        return $response;
    }
528864
protected function delete($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('delete', $url, $request);
    }
290236
public function get(string $url, array $headers = [])
    {
        $ctx = $this->getContext('GET', null, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
1055599
public function rawRequest(array $data = [], array $headers = []) {
        foreach ($headers as $header => $value) {
            $this->options[CURLOPT_HTTPHEADER][] = $header . ': ' . $value;
        }

        return $this->execute($data);
    }
804016
public static function postRequest(string $url, array $data = [])
    {
        $url = str_replace("&amp;", "&", urldecode(trim($url)));

        if (Validate::online($url)) {
            $options = array('http' => array('header' => "Content-type: application/x-www-form-urlencoded\r\n", 'method' => 'POST', 'content' => http_build_query($data)));
            $context = stream_context_create($options);

            return file_get_contents($url, false, $context);
        }

        return false;
    }
979766
public static function sendPost($_url, $_data, $_headers = [],
                                    $_return_header = true)
    {
        return self::sendCurl($_url,
                array(
                CURLOPT_SSL_VERIFYHOST => false,
                CURLOPT_SSL_VERIFYPEER => false,
                CURLOPT_FOLLOWLOCATION => 0,
                CURLOPT_POST => 1,
                CURLOPT_POSTFIELDS => $_data,
                CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
                CURLOPT_HTTPHEADER => $_headers,
                CURLOPT_HEADER => $_return_header
        ));
    }
1144625
public function get($url, array $data = [], array $headers = [])
    {
        $url = $this->optionParser->parseUrl($url, $data);

        $this->unsetOption(CURLOPT_POST);

        $this->setOptions([
            CURLOPT_CUSTOMREQUEST => 'GET',
            CURLOPT_HTTPGET => true
        ]);

        return $this->send($url, [], $headers);
    }
132166
protected function get($url, array $headers)
    {
        $request = [
            'headers' => array_merge(
                ['Content-Type' => 'application/json'],
                $headers
            ),
            'exceptions' => false,
        ];

        $this->request('get', $url, $request);
    }
999080
public function put($uri, array $headers = [], $datas = [], array $files = [])
    {
        return $this->send($uri, InternalRequestInterface::METHOD_PUT, $headers, $datas, $files);
    }