import json
import requests
url = 'http://developer.usa.gov/1usagov.json'
r = requests.get(url, stream=True)
for line in r.iter_lines():
if line:
print (json.loads(line))
Gives this error:
TypeError: can't use a string pattern on a bytes-like object
While viewing through the browser i do see that the response is a Json but request library says its a bytes like object why so ?