Why do I get “‘str’ object has no attribute ‘read'” when trying to use `json.load` on a string? [duplicate]

The problem is that for json.load you should pass a file like object with a read function defined. So either you use json.load(response) or json.loads(response.read()).

Leave a Comment