'raw_request' encoded to invalid json with single speech marks ''
Closed this issue · 1 comments
igorhoogerwoord commented
Because this dict is encoded to json with single speech marks '', it causes problems when decoding in _handle_http_error
Decoding this JSON string causes:
ValueError: Expecting property name: line 1 column 2 (char 1)
I'm trying to determine where this JSON is encoded, and if it is possible to return a regular dict, so no JSON encoding/decoding is required.
Update:
I see there are 3 different request methods in httpclient.py.
- verify the JSON encoding methods used in each one
- find where the raw_request is set and returned and if possible, return a regular dict instead of JSON
- JSON is not required for dicts used within the library so not using JSON for these avoids any encoding errors.
igorhoogerwoord commented
Fixed:
HTTPClient is set to return the raw_request property as a regular dictionary. There is no need to use the JSON encoding for use in the api itself.