I have the following, very basic code that throws; TypeError: the JSON object must be str, not \'bytes\'
TypeError: the JSON object must be str, not \'bytes\'
import requests import json url = \'my
Let requests decode it for you:
data = response.json()
This will check headers (Content-Type) and response encoding, auto-detecting how to decode the content correctly.