summaryrefslogtreecommitdiff
path: root/yarns
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2017-10-05 13:41:00 +0300
committerLars Wirzenius <liw@liw.fi>2017-10-05 18:01:45 +0300
commit6d27baeabb9074abaea61fb1dde8f36a4d66f5f5 (patch)
treed1e3f10489d5ae0d21218904e642c145677754c5 /yarns
parenta680144a3fb72e290eea6e3b24709d3477c418bd (diff)
downloadqvisqve-6d27baeabb9074abaea61fb1dde8f36a4d66f5f5.tar.gz
Add: capture HTTP response headers
Diffstat (limited to 'yarns')
-rw-r--r--yarns/lib.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/yarns/lib.py b/yarns/lib.py
index 26918a6..8460b7b 100644
--- a/yarns/lib.py
+++ b/yarns/lib.py
@@ -47,22 +47,22 @@ def add_postgres_config(config):
def get(url, headers=None):
print('get: url={} headers={}'.format(url, headers))
r = requests.get(url, headers=headers)
- return r.status_code, r.text
+ return r.status_code, dict(r.headers), r.text
def post(url, headers=None, body=None):
r = requests.post(url, headers=headers, data=body)
- return r.status_code, r.text
+ return r.status_code, dict(r.headers), r.text
def put(url, headers=None, body=None):
r = requests.put(url, headers=headers, data=body)
- return r.status_code, r.text
+ return r.status_code, dict(r.headers), r.text
def delete(url, headers=None):
r = requests.delete(url, headers=headers)
- return r.status_code, r.text
+ return r.status_code, dict(r.headers), r.text
def create_token_signing_key_pair():