simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
Why I am getting JsonDecodeError with disbursements even when the http response is 202? This is what I am getting back after calling transfer method;
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
This is the data I am pushing through;
headers
Out[9]:
{'X-Target-Environment': 'sandbox',
'Content-Type': 'application/json',
'Ocp-Apim-Subscription-Key': 'hidden',
'X-Reference-Id': 'hidden'}
data
Out[10]:
{'amount': '600',
'currency': 'EUR',
'externalId': '123456789',
'payee': {'partyIdType': 'MSISDN', 'partyId': '256772123456'},
'payerMessage': 'dd',
'payeeNote': 'dd'}
And these are the values of the resp variable;
resp
Out[20]: <Response [202]>
resp.headers
Out[21]: {'Content-Length': '0', 'Date': 'Thu, 23 May 2019 11:08:30 GMT'}
resp.status_code
Out[22]: 202
resp.text
Out[23]: ''
Its trying to decode an empty response as JSON. Let me file this as a bug and push a fix
Hey, I wasn't able to reproduce this. How are you getting the error?
The data I am pushing to the api and what I am getting back is all listed above.
Hi @oquidave please help us help you by telling us how to recreate your error. The "New Issue" template for "bug" details how to do this.
@raybesiga @mossplix Since this issue wasn't closed, I'll add to it instead of creating a new one.
Issue can be reproduced simply by installing simplejson
See POC here
Thanks for adding to this @jamesidw We shall look into it this week.
@jamesidw @oquidave did you ever get around this issue?
I am having the same problem now with client.requestToPay(). Was this looked into?