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

Method update_auth

aiohttp/client_reqrep.py:247–259  ·  aiohttp/client_reqrep.py::ClientRequest.update_auth

Set basic auth.

(self, auth)

Source from the content-addressed store, hash-verified

245 self.chunked = True class="cm"># enable chunked, no need to deal with length
246
247 def update_auth(self, auth):
248 class="st">""class="st">"Set basic auth."class="st">""
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 &class="cm">#x27;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