diff options
Diffstat (limited to 'yarns/lib.py')
-rw-r--r-- | yarns/lib.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/yarns/lib.py b/yarns/lib.py index 6575e6d..8f885c0 100644 --- a/yarns/lib.py +++ b/yarns/lib.py @@ -96,6 +96,14 @@ def get_token(user): return cat(filename) +def http(vars, func, url, **kwargs): + status, content_type, headers, body = func(url, **kwargs) + vars['status_code'] = status + vars['content_type'] = content_type + vars['headers'] = headers + vars['body'] = body + + def get(url, token): headers = { 'Authorization': 'Bearer {}'.format(token), |