PUTs data to the server
@param string $url The URL to grab
@param array $data The data to pass
@param array $headers additional HTTP options
@param array $curl_opts additional CURL options
@return string
@throws \Exception
15446
public function put($url, $data = [], $headers = [], $curl_opts = []) {
        $curl_opts[CURLOPT_CUSTOMREQUEST] = 'PUT';
        return $this->load($url, $data, $headers, $curl_opts);
    }
1165300
public function send($url, $method = 'GET', $data = null, callable $callback = null)
    {
        $this->curl($url);
        $this->setDefaultOptions();

        if (is_array($this->options))
        {
            if (count($this->options) > 0)
            {
                foreach ($this->options as $key => $value)
                {
                    $this->setOption($key, $value);
                }
            }
        }

        if ($method !== self::GET)
        {
            $this->method($method);
        }

        if ($method === self::POST || $method === self::PUT || $method === self::DELETE)
        {
            $this->setOption(CURLOPT_POSTFIELDS, $data);
        }

        $response = $this->execute();

        if (!$response)
        {
            $this->error();
        }

        $this->getInfo();
        $this->close();

        if ( is_callable($callback) )
        {
            $callback($this->response, $this->info, $this->errors);
        }

        return $response;
    }
120153
public function put($url, $params = array(), $curlOptions = array()) {
        $file = $params['file'];
        if (!is_file($file)){
            return null;
        }
        $fp   = fopen($file, 'r');
        $size = filesize($file);
        $curlOptions['CURLOPT_PUT']        = 1;
        $curlOptions['CURLOPT_INFILESIZE'] = $size;
        $curlOptions['CURLOPT_INFILE']     = $fp;
        if (!isset($this->curlOptions['CURLOPT_USERPWD'])){
            $curlOptions['CURLOPT_USERPWD'] = self::DEFAULT_USERPWD;
        }
        $ret = $this->request($url, $curlOptions);
        fclose($fp);
        return $ret;
    }
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
        ));
    }
1106537
protected function proccessRequest($url, &$params, &$data, $headers){

        $token = isset($params['access_token']) ? $params['access_token'] : '';
        $data['cuid'] = md5($token);

        if($url === $this->asrUrl){
            $data['token'] = $token;
            $data = json_encode($data);
        }else{
            $data['tok'] = $token;
        }

        unset($params['access_token']);
    }
579008
public function delete($url, $data = [], $headers = [], $curl_opts = []) {
        $curl_opts[CURLOPT_CUSTOMREQUEST] = 'DELETE';
        return $this->load($url, $data, $headers, $curl_opts);
    }
1359480
public static function upload($urlOrOptions, array $data = []): Curl
    {

        $options = $urlOrOptions;

        if (is_string($options))
        {
            $options = ['url' => $urlOrOptions];
        }

        if (!isset($options['url']))
        {
            throw new Exceptions\Invalid('Param option `URL` not found!');
        }

        $url    = $options['url'];
        $method = $options['method'] ?? 'post';
        $headers = $options['headers'] ?? [];

        $data = Arr::map($data, function ($value) {

            if (\is_string($value) && Str::first($value) === '@')
            {
                return curl_file_create(Str::withoutFirst($value));
            }

            return $value;

        });

        $curl = new Curl();

        if (!empty($headers))
        {
            foreach ($headers as $key => $value)
            {
                $headers[$key] = $key . ': ' . implode(',', (array)$value);
            }

            $curl->setOpt(CURLOPT_HTTPHEADER, Arr::getValues($headers));
        }

        $curl->$method($url, $data);

        $response = JSON::decode($curl->response);

        if (JSON::errorNone())
        {
            $curl->response = $response;
        }

        return $curl;

    }
904372
public function get($url, $data = null, $header = [])
    {
        $url = URLUtil::addParameter($url, $data);
        return $this->exec($url, $data, 'get', $header);
    }
1233984
public static function get($url, $query_data = null, array $headers = array(), array $options = array())
    {
        return self::request('GET', $url, $query_data, null, $headers, $options);
    }
29670
public function post($url, array $data, array $headers = null)
    {
        $headers = is_null($headers) ? ['Content-Type: application/json; charset=utf-8'] : $headers;
        return $this->sendRequest('POST', $url, $headers, $data);
    }
361103
private function _curl($url, $data = '', $method = 'get')
    {
        $parStr = '';
        if (is_array($data)) {
            $parStr = http_build_query($data);
        } else {
            $parStr = $data;
        }

        if (strtolower($method) == 'get') {
            $json = file_get_contents(rtrim($url, '?').'?'.$parStr);
        } else {
            $ch = curl_init();
            curl_setopt($ch, CURLOPT_URL, $url);
            curl_setopt($ch, CURLOPT_TIMEOUT, 30);
            curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
            curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
            curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
            curl_setopt($ch, CURLOPT_POST, 1);
            curl_setopt($ch, CURLOPT_POSTFIELDS, $parStr);
            $json = curl_exec($ch);
            curl_close($ch);
        }

        $result = json_decode($json, true);

        if (isset($result['errcode']) and $result['errcode'] != 0) {
            $this->_log("Error-{$method}-{$url}", $json, $data);
            return false;
        }

        return $result;
    }
191103
public function post(string $url, $data, array $headers = [])
    {
        if (is_array($data)) {
            $headers['Content-type'] = self::FORM_CONTENT_TYPE;
        }

        $ctx = $this->getContext('POST', $data, $headers);
        $response = file_get_contents($url, false, $ctx);
        $this->saveCookies($http_response_header);

        return $response;
    }
969655
public function post($url, $data, $headers = [])
    {
        $request = new Request('POST', $url, $headers);
        $response = $this->apiClient->send(
            $request,
            [
                'form_params' => $data,
            ]
        );
        $result = json_decode($response->getBody(), true);
        return $result;
    }
1327942
public function put($url, array $data = [])
    {
        $this->setopt(CURLOPT_URL, $url.'?'.http_build_query($data));
        $this->setopt(CURLOPT_CUSTOMREQUEST, 'PUT');
        $this->_exec();
    }
62784
protected function postRequest($url, $data) {
        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $url);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
        curl_setopt($ch, CURLOPT_HEADER, 0);
        curl_setopt($ch, CURLOPT_POST, true);
        curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
        $response = curl_exec($ch);
        curl_close($ch);

        if (!$response)
            throw new Exception("Error reading $url");

        if (( substr(strtolower($response), 0, 7) == "http://" ) || ( substr(strtolower($response), 0, 8) == "https://" )) {
            return $response;
        }
        else
            throw new Exception("Server response: " . strip_tags($response));
    }
1113370
public function post($uri, array $data = [], array $headers = [])
    {
        $server = $this->transformHeadersToServerVars($headers);

        return $this->call('POST', $uri, $data, [], [], $server);
    }
287125
public static function post($url, $params, $headers=null)
	{
		$self = new self();
		if ( is_array($params) ) {
			$params = http_build_query($params);
		}
		$curl = $self->_curlInit($url, $headers);
		curl_setopt($curl, CURLOPT_POST, true);
		curl_setopt($curl, CURLOPT_POSTFIELDS, $params);

		return $self->_doRequest($curl, false);
	}