MCPcopy
hub / github.com/encode/httpx / _build_auth_header

Method _build_auth_header

httpx/_auth.py:169–172  ·  view source on GitHub ↗
(self, username: str | bytes, password: str | bytes)

Source from the content-addressed store, hash-verified

167 yield request
168
169 def _build_auth_header(self, username: str | bytes, password: str | bytes) -> str:
170 userpass = b":".join((to_bytes(username), to_bytes(password)))
171 token = b64encode(userpass).decode()
172 return f"Basic {token}"
173
174
175class DigestAuth(Auth):

Callers 1

auth_flowMethod · 0.95

Calls 3

to_bytesFunction · 0.85
joinMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected