[issue29479] httplib: could not skip "ACCEPT-ENCODING" header

2021-06-20 Thread Irit Katriel


Irit Katriel  added the comment:

As Martin has stated, this can be achieved with putrequest as explained in the 
doc:

https://docs.python.org/3.10/library/http.client.html#http.client.HTTPConnection.putrequest

--
nosy: +iritkatriel
resolution:  -> not a bug
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29479] httplib: could not skip "ACCEPT-ENCODING" header

2017-02-08 Thread song1st

song1st added the comment:

Sorry, I thought I misunderstood the meaning.

I want no "ACCEPT-ENCODING" even "ACCEPT-ENCODING: identity".
I tried to modify the code from 
if 'accept-encoding' in header_names:
to
if not 'accept-encoding' in header_names:

The http request will be no "ACCEPT-ENCODING".
This is what I want.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29479] httplib: could not skip "ACCEPT-ENCODING" header

2017-02-08 Thread Martin Panter

Martin Panter added the comment:

Please explain what the wrong behaviour that you see is, and what you expect 
the right behaviour should be.

That code is intended to either keep any user-supplied Accept-Encoding header 
field, or send “Accept-Encoding: identity” if the field is not supplied.

If you are looking for a way to avoid adding this field entirely, see the lower 
level putrequest() and related methods. This is documented behaviour: 
.

--
nosy: +martin.panter
stage:  -> test needed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue29479] httplib: could not skip "ACCEPT-ENCODING" header

2017-02-08 Thread song1st

New submission from song1st:

When I tried to skip "ACCEPT-ENCODING" of header, I found the behavior was not 
right.
I think the issue is the following two "if" in _send_request of httplib.

def _send_request(self, method, url, body, headers):
# Honor explicitly requested Host: and Accept-Encoding: headers.
header_names = dict.fromkeys([k.lower() for k in headers])
skips = {}
if 'host' in header_names:
skips['skip_host'] = 1
if 'accept-encoding' in header_names:
skips['skip_accept_encoding'] = 1

--
components: Library (Lib)
messages: 287295
nosy: song1st
priority: normal
severity: normal
status: open
title: httplib: could not skip "ACCEPT-ENCODING" header
type: behavior
versions: Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com