This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients rhettinger
Date 2014-09-20.23:50:31
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1411257032.38.0.526589346468.issue22450@psf.upfronthosting.co.za>
In-reply-to
Content
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: */*
>
History
Date User Action Args
2014-09-20 23:50:32rhettingersetrecipients: + rhettinger
2014-09-20 23:50:32rhettingersetmessageid: <1411257032.38.0.526589346468.issue22450@psf.upfronthosting.co.za>
2014-09-20 23:50:32rhettingerlinkissue22450 messages
2014-09-20 23:50:32rhettingercreate