MCPcopy
hub / github.com/aio-libs/aiohttp / update_content_encoding

Method update_content_encoding

aiohttp/client_reqrep.py:233–245  ·  view source on GitHub ↗

Set request content encoding.

(self)

Source from the content-addressed store, hash-verified

231 self.headers[hdrs.COOKIE] = c.output(header='', sep=';').strip()
232
233 def update_content_encoding(self):
234 """Set request content encoding."""
235 enc = self.headers.get(hdrs.CONTENT_ENCODING, '').lower()
236 if enc:
237 if self.compress is not False:
238 self.compress = enc
239 # enable chunked, no need to deal with length
240 self.chunked = True
241 elif self.compress:
242 if not isinstance(self.compress, str):
243 self.compress = 'deflate'
244 self.headers[hdrs.CONTENT_ENCODING] = self.compress
245 self.chunked = True # enable chunked, no need to deal with length
246
247 def update_auth(self, auth):
248 """Set basic auth."""

Callers 1

__init__Method · 0.95

Calls 1

getMethod · 0.45

Tested by

no test coverage detected