Creates a put request and return the response data
970874
def _create_put_request(self, resource, billomat_id, command=None, send_data=None):
        
        assert (isinstance(resource, str))

        if isinstance(billomat_id, int):
            billomat_id = str(billomat_id)

        if not command:
            command = ''
        else:
            command = '/' + command

        response = self.session.put(
            url=self.api_url + resource + '/' + billomat_id + command,
            data=json.dumps(send_data),
        )

        return self._handle_response(response)
559614
def put(self, request, bot_id, id, format=None):
              
        return super(StateDetail, self).put(request, bot_id, id, format)
531024
def table_api_put(self, *paths, **kparams):
        
        url = self.flattened_params_url("/api/now/v1/table", *paths)

        # json.dumps(kparams) is the body of the put/post
        rjson = self.req("put", url, json.dumps(kparams)).text
        return json.loads(rjson)
694679
def put(self, uri, data, **kwargs):
        
        return self.request("PUT", uri, data=data, **kwargs)
550062
public String put(String path, Response data) {
		return request("PUT", path, data, getDefaultOptions());
	}
763934
def put(self, url, headers=None, body=None, kwargs=None):
        
        return self._request(
            method='put',
            url=url,
            headers=headers,
            body=body,
            kwargs=kwargs
        )
1042159
def _kput(url, data):
    '''  '''

    # Prepare headers
    headers = {"Content-Type": "application/json"}
    # Make request
    ret = http.query(url,
                     method='PUT',
                     header_dict=headers,
                     data=salt.utils.json.dumps(data))
    # Check requests status
    if ret.get('error'):
        return ret
    else:
        return salt.utils.json.loads(ret.get('body'))
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()
951802
def put(self, resource):
        

        endpoint = self.endpoint

        if resource.id:
            endpoint = self._build_url(endpoint, resource.id)

        response = self.api.execute("PUT", endpoint, json=resource.as_dict())

        if not response.ok:
            raise Error.parse(response.json())

        return self._cls.parse(response.json())
701806
def create(self, typ, data, return_response=False):
        
        res = self._request(typ, method='POST', data=data)
        if res.status_code != 201:
            try:
                data = res.json()
                self._throw(res, data)
            except ValueError as e:
                if not isinstance(e, InvalidRequestException):
                    self._throw(res, {})
                else:
                    raise

        loc = res.headers.get("location", None)
        if loc and loc.startswith('/'):
            return self._load(self._request(None, url=self.url_update(path=loc)))
        if return_response:
            return res.json()

        return self._load(self._request(None, url=loc))
1254582
def _handle_put(self, request):
        # type: (Put) -> CallbackResponses
        """"""
        attribute_name = request.path[1]

        attribute = self._block[attribute_name]
        assert isinstance(attribute, AttributeModel), \
            "Cannot Put to %s which is a %s" % (attribute.path, type(attribute))
        self.check_field_writeable(attribute)

        put_function = self.get_put_function(attribute_name)
        value = attribute.meta.validate(request.value)

        with self.lock_released:
            result = put_function(value)

        if request.get and result is None:
            # We asked for a Get, and didn't get given a return, so do return
            # the current value. Don't serialize here as value is immutable
            # (as long as we don't try too hard to break the rules)
            result = self._block[attribute_name].value
        elif not request.get:
            # We didn't ask for a Get, so throw result away
            result = None
        ret = [request.return_response(result)]
        return ret
743382
def _rest_put(self, suburi, request_headers, request_body):
        
        return self._rest_op('PUT', suburi, request_headers, request_body)
503533
def create_response(
        self, data: dict = None, response: requests.Response = None, errors: list = None
    ) -> Response:
        
        status = FAILURE_STATUS if errors else SUCCESS_STATUS
        return Response(
            status=status,
            provider=self.name,
            data=data,
            response=response,
            errors=errors,
        )
325473
def _put(self, url, attributes=None, **kwargs):
        

        return self._request('put', url, attributes, **kwargs)
49987
private function createHttpRequest(PutRequest $putRequest)
    {
        $request = $this->createRequest('POST', $putRequest->type, $putRequest->bucket, $putRequest->key);
        $data    = $this->opConverter->convert($putRequest->op);
        $query   = $request->getQuery();

        if ($putRequest->context !== null && is_array($data)) {
            $data['context'] = $putRequest->context;
        }

        if ($putRequest->w !== null) {
            $query->add('w', $putRequest->w);
        }

        if ($putRequest->dw !== null) {
            $query->add('dw', $putRequest->dw);
        }

        if ($putRequest->pw !== null) {
            $query->add('pw', $putRequest->pw);
        }

        if ($putRequest->returnBody !== null) {
            $query->add('returnbody', $putRequest->returnBody ? 'true' : 'false');
        }

        if ($putRequest->includeContext !== null) {
            $query->add('include_context', $putRequest->includeContext ? 'true' : 'false');
        }

        $request->setHeader('Accept', 'application/json');
        $request->setHeader('Content-Type', 'application/json');
        $request->setBody(Stream::factory(json_encode($data)));

        return $request;
    }
1168827
def put(self, url, data, headers=None):
        
        return self._request('PUT', url, data, headers=headers)
199157
def put_json(self, uri, data, **kwargs):
        
        encoded_data = json.dumps(data)
        kwargs.setdefault("headers", {}).update({
            "Content-Type": "application/json",  # tell server we are sending json
        })
        return self.put(uri, data=encoded_data, **kwargs)