Issue a PUT request to the specified endpoint with the data provided.

        :param url: str
        :pararm headers: dict
        :param data: dict
513311
def _put_request(self, url, headers, data=None):
        
        return self._session.put(url, headers=headers, data=data)
207968
def _post(self, endpoint, data, **kwargs):
        
        return self._request(endpoint, 'post', data, **kwargs)
930237
def doWebRequest(url, method="GET", data=None, headers={}):
    

    # Initialize variables
    response = None
    content = None
    # Find condition that matches request
    if method == "HEAD":
        request = HEADREQUEST(url, data=data, headers=headers)
    elif method == "PUT":
        request = PUTREQUEST(url, data=data, headers=headers)
    elif method == "DELETE":
        request = DELETEREQUEST(url, headers=headers)
    elif method == "GET":
        request = urllib2.Request(url, headers=headers)
    # POST?
    else:
        request = urllib2.Request(url, data=data, headers=headers)
    response = urllib2.urlopen(request)
    if response:
        content = response.read()
    return response, content
277845
def post(self, data):
        
        if not self.url:
            raise Error('URL for incoming webhook is undefined')

        return requests.post(self.url, data=json.dumps(data),
                             timeout=self.timeout, proxies=self.proxies)
1164665
def put(url, data=None, **kwargs):
    """"""
    _set_content_type(kwargs)
    if _content_type_is_json(kwargs) and data is not None:
        data = dumps(data)
    _log_request('PUT', url, kwargs, data)
    response = requests.put(url, data, **kwargs)
    _log_response(response)
    return response
537729
def patch(self, url, data=None, **kwargs):
        """"""
        return requests.patch(url, data=data, headers=self.add_headers(**kwargs))
795706
def append(self, path, data, **kwargs):
        
        metadata_response = self._post(
            path, 'APPEND', expected_status=httplib.TEMPORARY_REDIRECT, **kwargs)
        data_response = self._requests_session.post(
            metadata_response.headers['location'], data=data, **self._requests_kwargs)
        _check_response(data_response)
        assert not data_response.content
593989
def post(self, url, data=None, params=None):
        
        return self.request("post", url, data, params)
417299
def put(url, payload, options={}, &block)
      http_options = options.merge(@basic_options)
      if block_given?
        RestClient.put(url, payload, http_options, &block)
      else
        RestClient.put(url, payload, http_options)
      end

    end
129030
def put(self, json=None):
        
        return self._call('put', url=self.endpoint, json=json)
25887
def patch(self, url, data=None, params=None):
        
        return self.request("patch", url, data, params)
1190562
def _api_put(self, url, **kwargs):
        
        kwargs['url'] = self.url + url
        kwargs['auth'] = self.auth

        headers = deepcopy(self.headers)
        headers.update(kwargs.get('headers', {}))
        kwargs['headers'] = headers
        self._put(**kwargs)
451291
def put(self, url, data=None, body=None):
        
        response = self.http.put(url,
                                 headers=self.headers,
                                 data=body,
                                 params=data,
                                 **self.requests_params)

        return self.process(response)
27383
def request(self, url, method, data=None, headers=None):
        
        http_headers = merge_dict(self.default_headers, headers or {})
        request_data = merge_dict({'api_key': self.apikey}, data or {})

        logger.info('HTTP %s REQUEST TO %s' % (method, url))

        start = datetime.datetime.now()

        try:
            response = requests.request(method=method, url=url, data=json.dumps(request_data),
                                        headers=http_headers)
        except exceptions.BadRequestError as e:
            return json.loads({'errors': e.content})

        duration = datetime.datetime.now() - start

        logger.info('RESPONSE %s DURATION %s.%s' % (response.encoding, duration.seconds,
                                                    duration.microseconds))

        return json.loads(response.content) if response.content else {}
168857
public function put($url, $data, array $headers = array())
    {
        curl_setopt($this->handle, CURLOPT_CUSTOMREQUEST, 'PUT');

        $fields = is_array($data) ? http_build_query($data) : $data;
        curl_setopt($this->handle, CURLOPT_POSTFIELDS, $fields);

        $headers = array_replace($headers, ['Content-Length' => strlen($fields)]);
        return $this->execute($url, $headers);
    }
1096636
def request(self, url='', method = 'GET', data = None, parse=True, encoding=None):
        """"""

        requestparams = self.initrequest(data)


        if method == 'POST':
            request = requests.post
        elif method == 'DELETE':
            request = requests.delete
        elif method == 'PUT':
            request = requests.put
        else:
            request = requests.get

        r = request(self.url + url,**requestparams)
        if encoding is not None:
            r.encoding = encoding

        if r.status_code == 400:
            raise clam.common.data.BadRequest()
        elif r.status_code == 401:
            raise clam.common.data.AuthRequired()
        elif r.status_code == 403: #pylint: disable=too-many-nested-blocks
            content = r.text
            if parse:
                data = self._parse(content)
                if data:
                    if data.errors:
                        error = data.parametererror()
                        #print("DEBUG: parametererror=" + str(error),file=sys.stderr)
                        #for parametergroup, parameters in data.parameters: #pylint: disable=unused-variable
                        #    for parameter in parameters:
                        #        print("DEBUG: ", parameter.id, parameter.error,file=sys.stderr)
                        if error:
                            raise clam.common.data.ParameterError(error)
                    #print(content,file=sys.stderr)
                    raise clam.common.data.PermissionDenied(data)
                else:
                    raise clam.common.data.PermissionDenied(content)
            else:
                raise clam.common.data.PermissionDenied(content)
        elif r.status_code == 404 and data:
            raise clam.common.data.NotFound(r.text)
        elif r.status_code == 500:
            raise clam.common.data.ServerError(r.text)
        elif r.status_code == 405:
            raise clam.common.data.ServerError("Server returned 405: Method not allowed for " + method + " on " + self.url + url)
        elif r.status_code == 408:
            raise clam.common.data.TimeOut()
        elif not (r.status_code >= 200 and r.status_code <= 299):
            raise Exception("An error occured, return code " + str(r.status_code))

        if parse:
            return self._parse(r.text)
        else:
            return r.text
888842
def _put(self, uri, data):
        
        headers = self._get_headers()

        logging.debug("URI=" + str(uri))
        logging.debug("BODY=" + json.dumps(data))

        response = self.session.put(uri, headers=headers,
                data=json.dumps(data))
        if response.status_code in [201, 204]:
            return data
        else:
            logging.error(response.content)
            response.raise_for_status()