Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def put(self, resource, data=None, **kw):
if data:
kw = add_json_headers(kw)
data = json.dumps(data)
return self._session.put(self.url(resource), data, **kw)
def delete(self, resource, data=None,**kw):
if data:
data = json.dumps(data)
kw = add_json_headers(kw)
return self._session.request(method='DELETE', url=self.url(
resource), data=data, **kw)
return self._session.delete(self.url(resource), **kw)
def post(self, resource, data=None, **kw):
if data:
kw = add_json_headers(kw)
data = json.dumps(data)
return self._session.post(self.url(resource), data, **kw)