Low-level PUT request interface to mite. Takes a URL to request
        (relative), and optionally data to add to the request. Either returns
        the JSON body of the request or raises a HttpException.
10996
def put(self, url, data=None, params=None):
        
        return self.request("put", url, data, params)
1367678
private EtcdResult put(String key, List<BasicNameValuePair> data, Map<String, String> params, int[] expectedHttpStatusCodes,
                int... expectedErrorCodes) throws EtcdClientException {
        URI uri = buildUriWithKeyAndParams(key, params);
        HttpPut httpPut = new HttpPut(uri);

        UrlEncodedFormEntity entity = new UrlEncodedFormEntity(data, Charsets.UTF_8);
        httpPut.setEntity(entity);

        return syncExecute(httpPut, expectedHttpStatusCodes, expectedErrorCodes);
    }
878741
def post(self, url, data):
        
        try:
            res = requests.post(
                url, headers=self.headers, data=json.dumps(data))
            return json.loads(res.text)
        except Exception as e:
            print(e)
            return "error"
725453
def put(self, path, payload):
        """"""
        body = json.dumps(payload)
        return self._request(path, 'PUT', body)
889854
def put(self, url, data):
        
        response = self._run_method('PUT', url, data=data)
        log.debug("OUTPUT: %s" % response.content)
        return self._handle_response(url, response)
513311
def _put_request(self, url, headers, data=None):
        
        return self._session.put(url, headers=headers, data=data)
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
1348766
def put(query_url,
            headers: {},
            parameters: {})
      HttpRequest.new(HttpMethodEnum::PUT,
                      query_url,
                      headers: headers,
                      parameters: parameters)
    end
1248925
def _request_json(
    url,
    parameters=None,
    body=None,
    headers=None,
    cache=True,
    agent=None,
    reattempt=5,
):
    
    assert url
    content = None
    status = 500
    log.info("url: %s" % url)

    if isinstance(headers, dict):
        headers = _clean_dict(headers)
    else:
        headers = dict()
    if isinstance(parameters, dict):
        parameters = _d2l(_clean_dict(parameters))
    if body:
        method = "POST"
        headers["content-type"] = "application/json"
        headers["user-agent"] = _get_user_agent(agent)
        headers["content-length"] = ustr(len(body))
    else:
        method = "GET"
        headers["user-agent"] = _get_user_agent(agent)

    initial_cache_state = SESSION._is_cache_disabled  # yes, i'm a bad person
    try:
        SESSION._is_cache_disabled = not cache
        response = SESSION.request(
            url=url,
            params=parameters,
            json=body,
            headers=headers,
            method=method,
            timeout=1,
        )
        status = response.status_code
        content = response.json() if status // 100 == 2 else None
        cache = getattr(response, "from_cache", False)
    except RequestException as e:
        log.debug(e, exc_info=True)
        return _request_json(
            url, parameters, body, headers, cache, agent, reattempt - 1
        )
    except Exception as e:
        log.error(e, exc_info=True)
        if reattempt > 0:
            SESSION.cache.clear()
            return _request_json(
                url, parameters, body, headers, False, agent, 0
            )
    else:
        log.info("method: %s" % method)
        log.info("headers: %r" % headers)
        log.info("parameters: %r" % parameters)
        log.info("cache: %r" % cache)
        log.info("status: %d" % status)
        log.debug("content: %s" % content)
    finally:
        SESSION._is_cache_disabled = initial_cache_state

    return status, content
595999
def put_json(self, url, data, cls=None, **kwargs):
        
        kwargs['data'] = to_json(data, cls=cls)
        kwargs['headers'] = self.default_headers
        return self.put(url, **kwargs).json()
738007
def _do_put(self, uri, **kwargs):
        
        #TODO:
        # Add error handling. Check for HTTP status here would be much more conveinent than in each calling method
        scaleioapi_put_headers = {'content-type':'application/json'}
        print "_do_put()"
        if kwargs:
            for key, value in kwargs.iteritems():
                #if key == 'headers':
                #    scaleio_post_headers = value
                #    print "Adding custom PUT headers"
                if key == 'json':
                    payload = value
        try:
            self.logger.debug("do_put(): " + "{}".format(uri))

            #self._session.headers.update({'Content-Type':'application/json'})
            response = self._session.put(url, headers=scaleioapi_put_headers, verify_ssl=self._im_verify_ssl, data=json.dumps(payload))
            self.logger.debug("_do_put() - Response: " + "{}".format(response.text))
            if response.status_code == requests.codes.ok:
                return response
            else:
                self.logger.error("_do_put() - HTTP response error: " + "{}".format(response.status_code))
                raise RuntimeError("_do_put() - HTTP response error" + response.status_code)
        except:
            raise RuntimeError("_do_put() - Communication error with ScaleIO gateway")
        return response
1142554
def put(func: Callable, allowed_exceptions: List = None,
        title: str = None, req_obj_type: Callable = None) -> HTTPMethod:
    
    return HTTPMethod('put', func, allowed_exceptions=allowed_exceptions,
                      title=title, req_obj_type=req_obj_type)
691204
def put_resource(url, body):
    
    response = Bridge_DAO().putURL(url, PHEADER, body)
    log_data = "PUT %s %s ==status==> %s" % (url, body, response.status)

    if response.status != 200:
        _raise_exception(log_data, url, response)

    _log_resp(log_data, response.data)
    return response.data
1341210
def put(path, options={}, raw=false, unformatted=true)
      request(:put, path, options, raw, unformatted)
    end
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)
457410
def _put_subject(self, subject_id, body):
        
        assert isinstance(body, (dict)), "PUT requires body to be dict."

        # subject_id could be a path such as '/asset/123' so quote
        uri = self._get_subject_uri(guid=subject_id)
        return self.service._put(uri, body)
928544
def update(self, url, data):
        
        url = self.get_full_url(url)
        self.log.debug("update url : " + url)
        # Building request
        post_data = json.dumps(data).encode("UTF-8")
        request = urllib2.Request(url, post_data)
        request.add_header('Content-Type', 'application/json; charset=UTF-8')
        request.add_header('Accept', 'application/json')
        request.get_method = lambda: 'PUT'
        # Do request
        ret = self.do_request(request)
        self.log.debug("""put url : %(url)s : request time : %(time)s""",
                       {"url": url,
                        "time": self.last_req_time})
        return ret