发送restful PUT请求
@param $url
@param $params
@return mixed
430421
public static function put($url, $params) {
        $self = new self();
        if ( is_array($params) ) {
            $params = StringUtils::jsonEncode($params);
        }
        $curl = $self->_curlInit($url, array('Content-Type' => 'application/json'));
        curl_setopt($curl, CURLOPT_CUSTOMREQUEST, "PUT");
        curl_setopt($curl, CURLOPT_POSTFIELDS, $params);

        return $self->_doRequest($curl, false);
    }
547942
public function post($url, $parameters = [])
    {
        $url = static::LOCATION.$url;
        $headers = $this->buildHeaders();

        $request = $this->requestProvider->createRequest('POST', $url, $headers, json_encode($parameters));
        $response = $this->client->send($request);

        $this->errorCheckResponse($response);

        return json_decode($this->streamToString($response->getBody()));
    }
57891
public function get($url, $params = [])
    {
        if (is_array($url)) {
            return $this->mget($url, $params);
        }
        return $this->exec($this->buildRequest('GET', $url, $params));
    }
285457
public function getJson($url, $params = [])
    {
        $req = $this->buildRequest('GET', $url, $params);
        $req->setHeader('accept', 'application/json');
        $res = $this->exec($req);
        return $res === false ? false : $res->getJson();
    }
15446
public function put($url, $data = [], $headers = [], $curl_opts = []) {
        $curl_opts[CURLOPT_CUSTOMREQUEST] = 'PUT';
        return $this->load($url, $data, $headers, $curl_opts);
    }
208691
static function Put($url, $data = "", $verify_cert = false, $timeout = 30)
	{
		if (function_exists("curl_init"))
		{
			return HttpRequest::CurlPut($url, $data, $verify_cert, $timeout);
		}
		else
		{
			throw new Exception('PUT request is not supported on systems without curl installed');
		}
	}
1308562
protected function sendRequest($url, $params)
    {
        // Construct the cURL call
        $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_TIMEOUT, 0);
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);

        // Figure POST vs. GET
        if ($this->isPost()) {
            curl_setopt($ch, CURLOPT_POST, true);
            if ($this->isBinary()) {
                curl_setopt($ch, CURLOPT_POSTFIELDS, $this->getBinaryArgs());
            } else {
                curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
            }
        } else {
            curl_setopt($ch, CURLOPT_HTTPGET, true);
        }

        //Get the response
        $response = curl_exec($ch);

        if (!$response) {
            throw new Exceptions\ViddlerException(curl_error($ch));
        } else {
            $response = unserialize($response);
        }

        curl_close($ch);

        $response = $this->checkResponseForErrors($response);

        return $response;
    }
3247
public function put($params = null)
    {
        $handle = $this->preparePut($params);
        return $this->curlGetResponse($handle);
    }
1217189
private function _put($url, &$json)
    {
        curl_setopt($this->_curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT');
        return $this->_curlHelper($url, $json);
    }
948064
public function put($url, $data = [])
    {
        $this->setOpt(CURLOPT_URL, $url);
        $this->setOpt(CURLOPT_CUSTOMREQUEST, 'PUT');
        $this->setOpt(CURLOPT_POSTFIELDS, http_build_query($data));

        return $this->exec();
    }
685044
public function put($url, $data = '$undefined')
    {
        if ($data === '$undefined') {
            $data = ($url instanceof Resource)
                ? $url->data()
                : null;
        }
        return $this->request('put', $url, $data);
    }
962845
public function post($url, array $params)
    {
        $request = new Request(
            $url,
            'POST',
            'php://temp',
            ['content-type' => 'application/json']
        );

        $request->getBody()->write(json_encode($params));
        return $this->send($request);
    }
1327826
public static function update($params, $options = null)
    {
        $url = static::classUrl();
        return static::_directRequest('put', $url, $params, $options);
    }
1368919
def rest_put(self, url, params=None, headers=None, auth=None, verify=True, cert=None):
        
        res = requests.put(url, params=params, headers=headers, auth=auth, verify=verify,
                           cert=cert)
        return res.text, res.status_code
926379
public function put($url, $params = null) {
    $this->params = $params;
    $this->method = 'PUT';
    $this->url = $url;

    return $this->request();
  }
1331121
public function post($url, $params = null) {
    $this->params = $params;
    $this->method = 'POST';
    $this->url = $url;

    return $this->request();
  }
1303583
public function delete($url, array $params = [])
    {
        return $this->request($this->createUrl($url), self::METHOD_DELETE, $params);
    }