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

Method update_auth

aiohttp/client_reqrep.py:247–259  ·  view source on GitHub ↗

Set basic auth.

(self, auth)

Source from the content-addressed store, hash-verified

245 self.chunked = True # enable chunked, no need to deal with length
246
247 def update_auth(self, auth):
248 """Set basic auth."""
249 if auth is None:
250 auth = self.auth
251 if auth is None:
252 return
253
254 if not isinstance(auth, helpers.BasicAuth):
255 warnings.warn(
256 'BasicAuth() tuple is required instead ', DeprecationWarning)
257 auth = helpers.BasicAuth(*auth)
258
259 self.headers[hdrs.AUTHORIZATION] = auth.encode()
260
261 def update_body_from_data(self, data, skip_auto_headers):
262 if not data:

Callers 1

__init__Method · 0.95

Calls 1

encodeMethod · 0.95

Tested by

no test coverage detected