diff options
Diffstat (limited to 'client/gentoostats/utils.py')
-rw-r--r-- | client/gentoostats/utils.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/client/gentoostats/utils.py b/client/gentoostats/utils.py index 98f8375..43a3c73 100644 --- a/client/gentoostats/utils.py +++ b/client/gentoostats/utils.py @@ -2,9 +2,13 @@ import json import httplib +# json headers for gentoostats-cli headers = {'Accept': 'application/json'} def GET(server, url, headers, https=True): + """ + Get url from server using headers + """ if https: conn = httplib.HTTPSConnection(server) else: @@ -17,6 +21,9 @@ def GET(server, url, headers, https=True): return data def deserialize(object): + """ + Decode json object + """ try: decoded = json.JSONDecoder().decode(object) except (ValueError, TypeError): |