Message227194
The use of urllib for REST APIs is impaired in the absence of a "Accept: */*" header such as that added automatically by the requests package or by the CURL command-line tool.
# Example that gets an incorrect result due to the missing header
import urllib
print urllib.urlopen('http://graph.facebook.com/raymondh').headers['Content-Type']
# Equivalent call using CURL
$ curl -v http://graph.facebook.com/raymondh
...
* Connected to graph.facebook.com (31.13.75.1) port 80 (#0)
> GET /raymondh HTTP/1.1
> User-Agent: curl/7.30.0
> Host: graph.facebook.com
> Accept: */*
> |
|
Date |
User |
Action |
Args |
2014-09-20 23:50:32 | rhettinger | set | recipients:
+ rhettinger |
2014-09-20 23:50:32 | rhettinger | set | messageid: <1411257032.38.0.526589346468.issue22450@psf.upfronthosting.co.za> |
2014-09-20 23:50:32 | rhettinger | link | issue22450 messages |
2014-09-20 23:50:32 | rhettinger | create | |
|