While coding in python in many projects, I’ve encountered the error of firebase’s RealTime Database sending an integer instead of the json file. I’ve checked and I’ve imported the JSON packages, loaded the correct files (etc)
Here is the following code:
data = os.open('data/character.json', os.O_RDONLY)
data_send = firebase.post('/', data)
I’ve setup and ran everything in the database and it is connected. However, if you run this snippet of code, it returns simply: 4 as shown in the photo below.
The file character.json is in correct json format:
{
"username": "admin",
"gender": "male",
}
I do not see where “4” comes from and it is not intended. Does anyone know how this works?