diff options
Diffstat (limited to 'yarns/lib.py')
-rw-r--r-- | yarns/lib.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py index 486757c..00db015 100644 --- a/yarns/lib.py +++ b/yarns/lib.py @@ -122,6 +122,15 @@ def put(url, body_text, token): return r.status_code, r.headers['Content-Type'], dict(r.headers), r.text +def put_blob(url, body, token): + headers = { + 'Authorization': 'Bearer {}'.format(token), + 'Content-Type': 'application/octet-stream', + } + r = requests.put(url, headers=headers, data=body, verify=False) + return r.status_code, r.headers['Content-Type'], dict(r.headers), r.text + + def delete(url, token): headers = { 'Authorization': 'Bearer {}'.format(token), |