[issue22450] urllib doesn't put Accept: */* in the headers

Antoine Pitrou report at bugs.python.org
Sun Sep 21 02:07:18 CEST 2014


Antoine Pitrou added the comment:

> The content-type returned is text/javascript; charset=UTF-8 and with
> sending of Accept */* the content-type is set to application/json;
> charset=UTF-8 (which is more desirable).

Is that a bug in urllib, or in Facebook's HTTP implementation?
Frankly, we shouldn't jump to conclusions just because one specific use case is made better by this. Forcing an accept header may totally change the output of other servers and break existing uses.

(and besides, the content-type header is unimportant when you know what to expect, which is normally the case when calling an API)

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue22450>
_______________________________________


More information about the Python-bugs-list mailing list