Curl Works But Python Requests Doesn't
When I do curl, I get a response: root@3d7044bac92f:/home/app/tmp# curl -H 'Content-type: application/json' -X GET https://github.com/timeline.json -k {'message':'Hello there, wa
Solution 1:
You've made at least two errors in your program.
1) You haven't specified the data=
or headers
parameters to the requests.get()
call. Try this:
r = requests.get('https://github.com/timeline.json', data=data, headers=headers)
2) .json
is a method, not a data attribute of the response object. As a method, it must be called in order to be effective. Try this:
print r.json()
Post a Comment for "Curl Works But Python Requests Doesn't"