may need to json encode it yourself before you send it off, don't recall tho

so assuming `data` is your net dict

put(data=json.dumps(data))

The server error means it's having trouble parsing json from the data you currently send and failing at the first character it encounters.



On 28/01/2020 14.48, Elmar K. Bins wrote:
Hi Stefan,

[email protected] (Stefan Pratter) wrote:

print(r.json())

Ah, I've been looking for that; now it just tells me...
{'meta': {'error': 'JSON parse error - Expecting value: line 1 column 1 (char 
0)'}}


Ok, I've now tried putting data=...:

- Only the changes as a simple <dict>.
- The entire object (from data[0]) as a simple <dict>.
- The entire object (from data[0]) as {'data': [ <dict> ] }
- The entire object (from data[0]) plus empty meta as {'data': [ <dict> ], 
'meta': {} }

I'm always getting the JSON parse error.
Am I missing a conversion step somewhere?

json.dumps() looks alright in all cases.

- Elmar.
_______________________________________________
Pdb-tech mailing list
[email protected]
https://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech

_______________________________________________
Pdb-tech mailing list
[email protected]
https://lists.peeringdb.com/cgi-bin/mailman/listinfo/pdb-tech

Reply via email to