Make a PUT request.

        To make a PUT request pass, ``url``

        :param url: ``str``
        :param headers: ``dict``
        :param body: ``object``
        :param kwargs: ``dict``
763934
def put(self, url, headers=None, body=None, kwargs=None):
        
        return self._request(
            method='put',
            url=url,
            headers=headers,
            body=body,
            kwargs=kwargs
        )
433277
def _post_request(self, url, data=None, json=None, **kwargs):
        
        '''  '''
        
    # construct request kwargs
        request_kwargs = {
            'method': 'POST',
            'url': url,
            'data': data,
            'json': json
        }
        for key, value in kwargs.items():
            request_kwargs[key] = value

    # send request and handle response
        return self._request(**request_kwargs)
1320534
def send_request(input_data, api, url, headers, kwargs):
    
    data = {}
    if input_data != None:
        data['data'] = input_data

    # request that the API respond with a msgpack encoded result
    serializer = kwargs.pop("serializer", config.serializer)
    data['serializer'] = serializer

    data.update(**kwargs)

    json_data = json.dumps(data)

    response = requests.post(url, data=json_data, headers=headers)

    warning = response.headers.get('x-warning')
    if warning:
        warnings.warn(warning)

    cloud = urlparse(url).hostname
    if response.status_code == 503 and not cloud.endswith('.indico.io'):
        raise APIDoesNotExist("Private cloud '%s' does not include api '%s'" % (cloud, api))

    try:
        if serializer == 'msgpack':
            json_results = msgpack.unpackb(response.content)
        else:
            json_results = response.json()
    except (msgpack.exceptions.UnpackException, msgpack.exceptions.ExtraData):
        try:
            json_results = response.json()
        except:
            json_results = {"error": response.text}


    if config.PY3:
        json_results = convert(json_results)

    results = json_results.get('results', False)
    if results is False:
        error = json_results.get('error')
        raise convert_to_py_error(error)
    return results
145426
def _put(self, url, data={}):
        """"""
        req = self._session.put(self._api_prefix + url, data=data)
        return self._action(req)
65408
def request(self, url, method="GET", params=None, headers=None):
        
        params = params or {}
        headers = headers or {}

        logger.debug("URL: %s", url)
        logger.debug("Method: %s", method)
        logger.debug("Headers: %s", headers)
        logger.debug("Params: %s", params)
        
        response, content = self.client().request(url, method, headers=headers,
            body=urllib.urlencode(params))
        
        content = smart_unicode(content)

        logger.debug("Status: %s", response['status'])
        logger.debug("Content: %s", content)
        
        if response['status'] != '200':
            raise OAuthError(_(
                u"Invalid status code %s while requesting %s: %s") % (
                    response['status'], url, content))
        
        return content
1128241
def put(self, path, data, **options):
        
        data, options = self._update_request(data, options)
        return self.request('put', path, data=data, **options)
1115130
def put(self, url: StrOrURL,
            *, data: Any=None, **kwargs: Any) -> '_RequestContextManager':
        """"""
        return _RequestContextManager(
            self._request(hdrs.METH_PUT, url,
                          data=data,
                          **kwargs))
694679
def put(self, uri, data, **kwargs):
        
        return self.request("PUT", uri, data=data, **kwargs)
1006706
def _put(self, url, data={}):
        """"""
        r = requests.put(self._api_prefix + url,
            data=json.dumps(data),
            headers=self.headers,
            auth=self.auth,
            allow_redirects=False,
        )
        return self._action(r)
300232
def post(self, url):
        
        return requests.post(url, data=self.data, headers=self.config.HEADERS)
244825
public function put($url, $headers = [], $body = null)
    {
        return $this->send(Method::PUT, $url, $body, $headers);
    }
352054
def request(self, url, method="GET", params=None, headers=None, is_signed=True):
        
        params = params or {}
        headers = headers or {}
        
        if is_signed:
            params.update(self.get_signing_params())
        
        if method.upper() == "GET":
            url = '%s?%s' % (url, urllib.urlencode(params))
            return self.client().request(url, method=method, headers=headers)
        return self.client().request(url, method, body=urllib.urlencode(params), headers=headers)
1140396
def put(self, url, params=None, headers=None, content=None, form_content=None):
        # type: (str, Optional[Dict[str, str]], Optional[Dict[str, str]], Any, Optional[Dict[str, Any]]) -> ClientRequest
        
        request = self._request('PUT', url, params, headers, content, form_content)
        return request
894208
def option(self, url, headers=None, kwargs=None):
        
        return self._request(
            method='option',
            url=url,
            headers=headers,
            kwargs=kwargs
        )
1120448
def rest_put(url, data, timeout):
    ''''''
    try:
        response = requests.put(url, headers={'Accept': 'application/json', 'Content-Type': 'application/json'},\
                                data=data, timeout=timeout)
        return response
    except Exception as e:
        print('Get exception {0} when sending http put to url {1}'.format(str(e), url))
        return None
497990
def put(path, params)
      headers = {}

      request('PUT', path, params.to_json, headers) do |resp|
        yield(resp) if block_given?
      end
    end
1088932
def prepare_request(self, method, url, body=''):
        
        headers = {
            'Content-type': 'application/json',
        }
        # Note: we don't pass body to sign() since it's only for bodies that
        # are form-urlencoded. Similarly, we don't care about the body that
        # sign() returns.
        uri, signed_headers, signed_body = self.oauth_client.sign(
            url, http_method=method, headers=headers)
        if body:
            if method == 'GET':
                body = urllib.urlencode(body)
            else:
                body = json.dumps(body)
        headers.update(signed_headers)
        return {"headers": headers, "data": body}