I am making a server connected pygame script that handles multiplayer movements and updates it on the player’s screen. For every request in the python file I add an extra header named “Auth” that I use in the get/put/post functions for express, in order to differentiate programs and authenticate http requests. My issue here is that when I send over a JSON file, the response on the python program which GETs the file is simply response code 200, which I cannot decode from JSON
For example:
Defining data:
let data = require(__dirname + "\gamedata.json")
If statement:
app.get('/', (req, res) => {
Auth = presentRequest(req)
//Other code before this
} else if (Auth == '2DDR') {
res.json(data)
console.log("Sent")
}
})
Python request:
reqjson = request() // Class that makes requests, params: method, headers, data to send
response = reqjson.makereq('GET', {'Auth': '2DDR'}, None)
print(response.json())
datadict = response.json()
players = datadict.get('Players', [])
Throws:
”
Traceback (most recent call last):
File “ControlAndDisplay.py”, line 145, in
print(response.json())
File “AppDataLocalProgramsPythonPython310libsite-packagesrequestsmodels.py”, line 900, in json
return complexjson.loads(self.text, **kwargs)
File “AppDataLocalProgramsPythonPython310libjson_init_.py”, line 346, in loads
return _default_decoder.decode(s)
File “AppDataLocalProgramsPythonPython310libjsondecoder.py”, line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File “AppDataLocalProgramsPythonPython310libjsondecoder.py”, line 355, in raw_decode
raise JSONDecodeError(“Expecting value”, s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
“
I’ve tried putting the exact path, changing the name of the json, messing around with the Auth, but nothing works and I don’t know what to do. It was supposed to send back over the JSON to the client for further handling but instead as mentioned it just sends over the response code 200 as “<Response [200]>”

