Make an HTTP PUT request to the specified endpoint.

Requires a tmpfile() handle to be opened on the system, as the cURL
API requires it to send data.

@param string $uri URI address to request
@param string $data data of the request body
164669
public function put($uri, $data)
	{
		$ch = $this->initializeRequest();

		$handle = tmpfile();
		fwrite($handle, $data);
		fseek($handle, 0);
		curl_setopt($ch, CURLOPT_INFILE, $handle);
		curl_setopt($ch, CURLOPT_INFILESIZE, strlen($data));

		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');
		curl_setopt($ch, CURLOPT_URL, $uri);
		curl_setopt($ch, CURLOPT_PUT, true);
		curl_exec($ch);

		$this->checkResponse($ch);

		curl_close($ch);

		return $this;
	}
1200598
public function write(string $uri, $data)
    {
        // Create directory recursively if it doesn't exist
        if ( ! file_exists(dirname($uri))) {
            mkdir(dirname($uri), 0755, true);
        }

        // Write file to target directory
        if ( ! file_put_contents($uri, $data)) {
            throw new ErrorException("Failed to write output to file: ".$uri);
        }

        return true;
    }
885045
public function put($uri, $fields)
    {
        $url = $this->getURI($uri);
        return custom_http_request('PUT', $url, $fields, $this->getAuth());
    }
671259
private function addPostData($Resource, $data) {
        if (!empty($data)) {
            switch ($this->Request->getContentTypeCode()) {
                case Request::CONTENT_TYPE_UNDEFINED:
                    $string = http_build_query($data);
                    break;
                case Request::CONTENT_TYPE_JSON:
                    $string = json_encode($data);
                    break;
                case Request::CONTENT_TYPE_TEXT:
                    $string = (string) $data;
                    break;
                case Request::CONTENT_TYPE_XML:
                    if ($data instanceof DOMDocument) {
                        $string = $data->saveXML();
                    } else {
                        $string = (string) $data;
                    }
                    break;
                default:
                    throw new HttpContentTypeException();
            }
            curl_setopt_array($Resource, array(
                CURLOPT_POST    => true,
                CURLOPT_POSTFIELDS => $string,
            ));
        }
    }
1085119
public static function put($urls, $data = null, callable $callback = null)
    {
        return static::make('put', $urls, $data, $callback);
    }
210581
def post(self, uri, data, **kwargs):
        
        return self.request("POST", uri, data=data, **kwargs)
1168762
public function post($uri, AbstractRequest $request = null)
    {
        $http = $this->getHttpClone();

        $http->setOption(CURLOPT_POST, true);
        $http->setOption(CURLOPT_URL, $uri);
        if ($request) {
            $http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery()));
        }

        return $http->execute();
    }
694679
def put(self, uri, data, **kwargs):
        
        return self.request("PUT", uri, data=data, **kwargs)
665454
public function put($url, array $data = [])
    {
        $this->resetAndAssociateUrl($url);

        if (!curl_setopt($this->ch, CURLOPT_PUT, true)) {
            $this->addFields($data);
        }

        return new Parser($this->ch);
    }
311378
public function post($uri, array $headers = [], $datas = [], array $files = [])
    {
        return $this->send($uri, InternalRequestInterface::METHOD_POST, $headers, $datas, $files);
    }
67230
public function post($url, $data)
	{
		$this->init($url);
		$this->setPost($data);
		$this->exec();
		$this->fin();
	}
44254
public function put($url, array $data = [], array $headers = [])
    {
        $this->unsetOptions([CURLOPT_HTTPGET, CURLOPT_POST]);

        $this->setOption(CURLOPT_CUSTOMREQUEST, 'PUT');

        return $this->send($url, $data, $headers);
    }
123158
public function put(String $url = NULL, $data = NULL)
    {
        return $this->_customRequest($url, URL::buildQuery($this->data ?? $data), __FUNCTION__);
    }
731522
public function post($uri, $data)
	{
		$ch = $this->initializeRequest();

		if (is_array($data)) {
			$data = http_build_query($data);
		}

		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
		curl_setopt($ch, CURLOPT_URL, $uri);
		curl_setopt($ch, CURLOPT_POST, true);
		curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
		curl_exec($ch);

		$this->checkResponse($ch);

		curl_close($ch);

		return $this;
	}
1278850
public function doPostRequest($uri, $data = null)
    {
        return $this->doRequest(Request::POST, $uri, $data);
    }
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));
    }
103568
public function put($uri, AbstractRequest $request = null)
    {
        $http = $this->getHttpClone();

        $http->setOption(CURLOPT_CUSTOMREQUEST, 'PUT');
        $http->setOption(CURLOPT_URL, $uri);
        if ($request) {
            $http->setOption(CURLOPT_POSTFIELDS, $this->buildPostData($request->getQuery()));
        }

        return $http->execute();
    }