PUTs a resource.

@param  String $location
@param  String $body
@return CurlClientResponse
553604
public function put($location, $body)
    {
        curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT');
        curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body);
        curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json'));

        return $this->execute('PUT', $location);
    }
282069
public function __doRequestByCurl($request, $location, $action, $version, $one_way = FALSE)
	{
		// Call via Curl and use the timeout a
		$curl = curl_init($location);
		if ($curl === false) {
			throw new ClientException('Curl initialisation failed');
		}
		/** @var $headers array of headers to be sent with request */
		$headers = array(
			'User-Agent: PHP-SOAP',
			'Content-Type: text/xml; charset=utf-8',
			'SOAPAction: "' . $action . '"',
			'Content-Length: ' . strlen($request),
		);
		$options = array(
			CURLOPT_VERBOSE        => false,
			CURLOPT_RETURNTRANSFER => true,
			CURLOPT_POST           => true,
			CURLOPT_POSTFIELDS     => $request,
			CURLOPT_HEADER         => $headers,
			CURLOPT_HTTPHEADER     => array(sprintf('Content-Type: %s', $version == 2 ? 'application/soap+xml' : 'text/xml'), sprintf('SOAPAction: %s', $action)),
		);
		// Timeout in milliseconds
		$options = $this->__curlSetTimeoutOption($options, $this->timeout, 'CURLOPT_TIMEOUT');
		// ConnectTimeout in milliseconds
		$options = $this->__curlSetTimeoutOption($options, $this->connectTimeout, 'CURLOPT_CONNECTTIMEOUT');

		$this->__setCurlOptions($curl, $options);
		$response = curl_exec($curl);
		$this->lastResponse = $response;

		if (curl_errno($curl)) {
			$errorMessage = curl_error($curl);
			$errorNumber  = curl_errno($curl);
			curl_close($curl);
			throw new ClientException($errorMessage, $errorNumber);
		}

		$header_len = curl_getinfo($curl, CURLINFO_HEADER_SIZE);
		$header = substr($response, 0, $header_len);
		$body = substr($response, $header_len);
		$this->lastResponseBody = $body;

		curl_close($curl);
		// Return?
		if ($one_way) {
			return null;
		} else {
			return $body;
		}
	}
912232
public function put($resource, $data = [])
    {
        $exec = $this->execute(Method::$HTTP_PUT, $resource, ['json' => $data]);

        return $exec;
    }
98400
public function putBody($id, $body, $guestSpaceId = null): array
    {
        $options = ['json' => compact('id', 'body')];

        /** @var JsonStream $stream */
        $stream = $this->client
            ->put(KintoneApi::generateUrl('space/body.json', $guestSpaceId), $options)
            ->getBody();

        return $stream->jsonSerialize();
    }
219346
public function put($account, $action, $parameters = null, $httpHeadersToSet = array())
    {
        return $this->sendRequest('PUT', $account, $action, $parameters, null, null, $httpHeadersToSet);
    }
601878
public static function bodyCurl($url, $method, $body, $header) {
      if ( ! function_exists('curl_init') ) return false;
      global $last_http_response;
      global $LastHeadersSent;
      global $LastHeadersReceived;
      global $LastBODYImpl;
      global $LastBODYMethod;
      global $LastBODYContent;

      $ch = curl_init();
      curl_setopt($ch, CURLOPT_URL, $url);

      // Make sure that the header is an array and pitch white space
      $LastHeadersSent = trim($header);
      $header = explode("\n", trim($header));
      $htrim = Array();
      foreach ( $header as $h ) {
        $htrim[] = trim($h);
      }
      curl_setopt ($ch, CURLOPT_HTTPHEADER, $htrim);

      if ( $method == "POST" ) {
        curl_setopt($ch, CURLOPT_POST, 1);
      } else {
        curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
      }

      curl_setopt($ch, CURLOPT_POSTFIELDS, $body);

      curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); // ask for results to be returned
      curl_setopt($ch, CURLOPT_HEADER, 1);

      // Thanks to more and more PHP's not shipping with CA's installed
      // This becomes necessary
      if ( static::$VERIFY_PEER ) {
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2);
      } else {
        curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
        curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
      }

      // Send to remote and return data to caller.
      $result = curl_exec($ch);
      $info = curl_getinfo($ch);
      $last_http_response = $info['http_code'];
      if(curl_errno($ch))
      {
          error_log('Curl error: ' . curl_error($ch));
      }
      $header_size = curl_getinfo($ch, CURLINFO_HEADER_SIZE);
      $LastHeadersReceived = substr($result, 0, $header_size);
      $body = substr($result, $header_size);
      if ( $body === false ) $body = ''; // Handle empty body
      curl_close($ch);
      $LastBODYContent = $body;
      $LastBODYImpl = "CURL";
      $LastBODYMethod = $method;
      return $body;
    }
885045
public function put($uri, $fields)
    {
        $url = $this->getURI($uri);
        return custom_http_request('PUT', $url, $fields, $this->getAuth());
    }
1217189
private function _put($url, &$json)
    {
        curl_setopt($this->_curlHandle, CURLOPT_CUSTOMREQUEST, 'PUT');
        return $this->_curlHelper($url, $json);
    }
898064
public function put($url, $parameters = [])
    {
        $httpClient = $this->client->getHttpClient();

        $response = $httpClient->put($url, $parameters);

        return $httpClient->parseResponse($response);
    }
76661
public function put(string $path, array $query = [], array $body = []): ResponseInterface
    {
        return $this->request('PUT', $path, $query, $body);
    }
1249548
public function put(string $url, array $params = [])
    {
        return $this->send('PUT', $url, [
            $this->bodyFormat => $params,
        ]);
    }
1049640
public function setBody($method, $httpBody)
    {

        $this->setCurlOption(CURLOPT_CUSTOMREQUEST, $method);
        if(!empty($httpBody)) {
            $this->setCurlOption(CURLOPT_POSTFIELDS, $httpBody);
        }
    }
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;
    }
567020
public function put($service, $headers = [], $body = '', $form_params = [])
    {
        return $this->callRestService('PUT', $service, $headers, $body, $form_params);
    }
446823
public function __doRequest($request, $location, $action, $version, $one_way = false) {

		// Authenticate with SP online in order to get required authentication cookies
		if (!$this->authCookies) $this->configureAuthCookies($location);

		// Set base headers
		$headers = array();
		$headers[] = "Content-Type: text/xml;";
		$headers[] = "SOAPAction: \"{$action}\"";

		$curl = curl_init($location);

		curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);
		curl_setopt($curl, CURLOPT_POST, TRUE);

		// Send request and auth cookies.
		curl_setopt($curl, CURLOPT_POSTFIELDS, $request);
		curl_setopt($curl, CURLOPT_COOKIE, $this->authCookies);

		curl_setopt($curl, CURLOPT_TIMEOUT, 10);
		curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE);

		// Useful for debugging
		curl_setopt($curl, CURLOPT_VERBOSE,FALSE);
		curl_setopt($curl, CURLOPT_HEADER, FALSE);

		// Add headers
		curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);

		// Init the cURL
		$response = curl_exec($curl);

		// Throw exceptions if there are any issues
		if (curl_errno($curl)) throw new \SoapFault('Receiver', curl_error($curl));
		if ($response == '') throw new \SoapFault('Receiver', "No XML returned");

		// Close CURL
		curl_close($curl);

		// Return?
		if (!$one_way) return ($response);
	}
374553
public function setBody($body)
    {
        $body = json_encode($body);

        if ($error = json_last_error()) {
            throw new \ErrorException($error);
        }

        curl_setopt($this->curlHandler, CURLOPT_POSTFIELDS, $body);

        return $this;
    }
371160
public function putServerConfig($serverName, $body)
    {
        list($response) = $this->putServerConfigWithHttpInfo($serverName, $body);
        return $response;
    }