Skip to content

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

Open

Description

@oquidave

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]: ''

Activity

  1. mossplix commented on May 23, 2019

    @mossplix
    Member

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

  2. self-assigned this
    on May 23, 2019
  3. mossplix commented on May 27, 2019

    @mossplix
    Member

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

  4. oquidave commented on May 27, 2019

    @oquidave
    Author

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

  5. raybesiga commented on May 28, 2019

    @raybesiga
    Member

    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.

  6. jamesidw commented on Sep 27, 2019

    @jamesidw

    @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

  7. raybesiga commented on Sep 29, 2019

    @raybesiga
    Member

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

  8. raybesiga commented on Dec 4, 2020

    @raybesiga
    Member

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

  9. crukundo commented on Feb 18, 2022

    @crukundo

    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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ Proxy