smiley/steamapi

JSONDecodeError when connecting to API

tairun opened this issue · 1 comments

After installing and importing the library (which both give no errors, requests 2.8.13 is installed) I get the following error when connecting to the API like this:
steamapi.core.APIConnection(api_key="<API-KEY>", validate_key=True)

(Btw I changed the API-Key to a placeholder here)

Traceback (most recent call last):
  File "test.py", line 3, in <module>
    steamapi.core.APIConnection(api_key="<API-KEY>", validate_key=True)
  File "C:\localstore\python\3.6.2\lib\site-packages\steamapi-0.1-py3.6.egg\steamapi\decorators.py", line 117, in __call__
    self._instance = self._decorated(*args, **kwargs)
  File "C:\localstore\python\3.6.2\lib\site-packages\steamapi-0.1-py3.6.egg\steamapi\core.py", line 408, in __init__
    self.call("ISteamWebAPIUtil", "GetSupportedAPIList", "v1")
  File "C:\localstore\python\3.6.2\lib\site-packages\steamapi-0.1-py3.6.egg\steamapi\core.py", line 462, in call
    response_obj = response.json()
  File "C:\localstore\python\3.6.2\lib\site-packages\requests-2.18.3-py3.6.egg\requests\models.py", line 892, in json
    return complexjson.loads(self.text, **kwargs)
  File "C:\localstore\python\3.6.2\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\localstore\python\3.6.2\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\localstore\python\3.6.2\lib\json\decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

I'm using python version 3.6.x 32 and 64bit. I have tried this on 3 different windows PCs. 1 works and 2 don't. So far no idea why.

Alright so I found the issue, totally my bad. The two other PCs i tried were in the same network at my firm. Turns out they blocked access to some domains :-/.