Forums

application working in local does not work in pa

hi When the program that returns json sentences with requests in local is running in PA,

"Traceback (most recent call last):
   File "/home/rotayazilim/mysite/session.py", line 124, in <module>
     session feir(strsisEK,server,wsuser,wspassword,apikey)
   File "/home/rotayazilim/mysite/session.py", line 35, in sessiongetir
     jsonws = resp.json()
   File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json
     return complexjson.loads(self.text, **kwargs)
   File "/usr/local/lib/python3.10/site-packages/simplejson/__init__.py", line 525, in loads
     return _default_decoder.decode(s)
   File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 370, in decode
     obj, end = self.raw_decode(s)
   File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 400, in raw_decode
     return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 2 column
1 (char 1)"

Is Requests not working or is there some other problem with json? thanks in advance

What is your code doing?

The code I wrote connects to the program with an api, takes json sentences and turns them into a table. is using requests.

<Response [411]> Traceback (most recent call last): File "/home/rotayazilim/mysite/session.py", line 132, in <module> sessiongetir("sis/json",sunucu,wskullanici,wspassword,apikey) File "/home/rotayazilim/mysite/session.py", line 40, in sessiongetir jsonws = resp.json() File "/usr/local/lib/python3.10/site-packages/requests/models.py", line 971, in json return complexjson.loads(self.text, **kwargs) File "/usr/local/lib/python3.10/site-packages/simplejson/init.py", line 525, in loads return _default_decoder.decode(s) File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 370, in decode obj, end = self.raw_decode(s) File "/usr/local/lib/python3.10/site-packages/simplejson/decoder.py", line 400, in raw_decode return self.scan_once(s, idx=_w(s, idx).end()) simplejson.errors.JSONDecodeError: Expecting value: line 2 column 1 (char 1) >>> Response 411

Maybe add some logging and check how the resp object looks like (before you call json on it), when you run the code on PA and compared to your local setup.