How to use the stashy.helpers.add_json_headers function in stashy

To help you get started, we’ve selected a few stashy examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github cosmin / stashy / stashy / client.py View on Github external
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)
github cosmin / stashy / stashy / client.py View on Github external
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)
github cosmin / stashy / stashy / client.py View on Github external
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)