Skip to content

response.json() produces JSONDecodeError error since content is in invalid format #228

@pcnoic

Description

@pcnoic

Bug

When trying to work with the clientlogin method and using the default example from the documentation the user may encounter an issue where the response.json() produces json encoding error in the runtime. For example a common error would be:

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

Expected behavior

Received the response that is documented in the docs:

{  
   "clientlogin":{  
      "status":"PASS",
      "username":"William"
   }
}

Workaround

I'd suggest parsing the response using:

data = json.loads(response.content)

instead of:

data = response.json()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions