Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

simplejson.errors.JSONDecodeError: Expecting value: line 1 column 1 (char 0) #24

Open
oquidave opened this issue May 23, 2019 · 8 comments
Assignees
Labels
bug Something isn't working

Comments

@oquidave
Copy link

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]: ''
@mossplix
Copy link
Member

Its trying to decode an empty response as JSON. Let me file this as a bug and push a fix

@mossplix mossplix added the bug Something isn't working label May 23, 2019
@mossplix mossplix self-assigned this May 23, 2019
@mossplix
Copy link
Member

Hey, I wasn't able to reproduce this. How are you getting the error?

@oquidave
Copy link
Author

The data I am pushing to the api and what I am getting back is all listed above.

@raybesiga
Copy link
Member

raybesiga commented May 28, 2019

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.

@jamesidw
Copy link

@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

@raybesiga
Copy link
Member

Thanks for adding to this @jamesidw We shall look into it this week.

@raybesiga
Copy link
Member

@jamesidw @oquidave did you ever get around this issue?

@crukundo
Copy link

I am having the same problem now with client.requestToPay(). Was this looked into?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants