psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.13k stars 9.32k forks source link

From Expecting value: line 1 column 1 (char 0) to Response content not in json format #6323

Closed hasnainhakim closed 1 year ago

hasnainhakim commented 1 year ago

Hi Please run:

    res = self.session.post(url=self.url, data=json.dumps(data), headers=self.h, verify=False)
    try:
        js = res.json()
        token = js['token']
        self.cookie['reese84'] = token
        print(fg + ' (success)')
        return token
    except ValueError:
        print("Response content is not valid JSON")

I am getting this :

[*] Fetching TokenResponse content is not valid JSON

sethmlarson commented 1 year ago

We can't help you debug general Python code, this issue tracker is only for defects in the Requests library. I recommend trying stackoverflow.com/ or the Python Discord.