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

Method _build_auth_header

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

Source from the content-addressed store, hash-verified

137 yield request
138
139 def _build_auth_header(self, username: str | bytes, password: str | bytes) -> str:
140 userpass = b":".join((to_bytes(username), to_bytes(password)))
141 token = b64encode(userpass).decode()
142 return f"Basic {token}"
143
144
145class NetRCAuth(Auth):

Callers 1

__init__Method · 0.95

Calls 3

to_bytesFunction · 0.85
joinMethod · 0.80
decodeMethod · 0.45

Tested by

no test coverage detected