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 Arfrever, martin.panter, orsenthil, pitrou, rhettinger
Date 2016-08-30.21:17:55
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1472591875.78.0.707534585638.issue22450@psf.upfronthosting.co.za>
In-reply-to
Content
Update:  After more research, I learned that while 'Accept: */*' should not have an effect on the origin webserver, it can and does have an effect on proxy servers.

Origin servers are allowed to vary the content-type of responses when given different Accept headers.  When they do so, they should also send "Vary: Accept".   

Proxy servers such as NGinx and Varnish respond to the "Vary: Accept" by caching the different responses using a combination of url and the accept header as the cache key.  If the request has 'Accept: */*', then the cache lookup returns the same result as if the 'Accept: */*' had been passed directly to the server.  However, if the Accept header is omitted, the proxy cache can return any of the cached responses (typically the most recent, regardless of content-type).

Accordingly, it is a good practice to include 'Accept: */*' in the request so that you get a consistent result (what the server would have returned) rather than the inconsistent and unpredictable content-types you would receive in the absence of the Accept header.  I believe that is why the other tools and book examples use 'Accept: */*' even though the origin wouldn't care.
History
Date User Action Args
2016-08-30 21:17:55rhettingersetrecipients: + rhettinger, orsenthil, pitrou, Arfrever, martin.panter
2016-08-30 21:17:55rhettingersetmessageid: <1472591875.78.0.707534585638.issue22450@psf.upfronthosting.co.za>
2016-08-30 21:17:55rhettingerlinkissue22450 messages
2016-08-30 21:17:55rhettingercreate