diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-11-05 12:50:11 +0100 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-11-05 12:50:11 +0100 |
commit | 7aec1bd1ead044af596ccbb926c7bed9c633737d (patch) | |
tree | 55d403f32ff0d2038b5a9bb8fd6717462a31710e /yarns | |
parent | 3828e97529d0d606a5b3074442ec02ae3c22193a (diff) | |
download | ick2-7aec1bd1ead044af596ccbb926c7bed9c633737d.tar.gz |
ADd: return headers from HTTP responses
Diffstat (limited to 'yarns')
-rw-r--r-- | yarns/lib.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/yarns/lib.py b/yarns/lib.py index b508389..d5559b1 100644 --- a/yarns/lib.py +++ b/yarns/lib.py @@ -99,7 +99,7 @@ def post(url, body_text, token): 'Content-Type': 'application/json', } r = requests.post(url, headers=headers, data=body_text, verify=False) - return r.status_code, r.headers['Content-Type'], r.text + return r.status_code, r.headers['Content-Type'], dict(r.headers), r.text def put(url, body_text, token): @@ -108,7 +108,7 @@ def put(url, body_text, token): 'Content-Type': 'application/json', } r = requests.put(url, headers=headers, data=body_text, verify=False) - return r.status_code, r.headers['Content-Type'], r.text + return r.status_code, r.headers['Content-Type'], dict(r.headers), r.text def delete(url, token): @@ -116,4 +116,4 @@ def delete(url, token): 'Authorization': 'Bearer {}'.format(token), } r = requests.delete(url, headers=headers, verify=False) - return r.status_code, r.headers['Content-Type'], r.text + return r.status_code, r.headers['Content-Type'], dict(r.headers), r.text |