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

Method _send_handling_auth

httpx/_client.py:1645–1677  ·  view source on GitHub ↗
(
        self,
        request: Request,
        auth: Auth,
        follow_redirects: bool,
        history: list[Response],
    )

Source from the content-addressed store, hash-verified

1643 raise exc
1644
1645 async def _send_handling_auth(
1646 self,
1647 request: Request,
1648 auth: Auth,
1649 follow_redirects: bool,
1650 history: list[Response],
1651 ) -> Response:
1652 auth_flow = auth.async_auth_flow(request)
1653 try:
1654 request = await auth_flow.__anext__()
1655
1656 while True:
1657 response = await self._send_handling_redirects(
1658 request,
1659 follow_redirects=follow_redirects,
1660 history=history,
1661 )
1662 try:
1663 try:
1664 next_request = await auth_flow.asend(response)
1665 except StopAsyncIteration:
1666 return response
1667
1668 response.history = list(history)
1669 await response.aread()
1670 request = next_request
1671 history.append(response)
1672
1673 except BaseException as exc:
1674 await response.aclose()
1675 raise exc
1676 finally:
1677 await auth_flow.aclose()
1678
1679 async def _send_handling_redirects(
1680 self,

Callers 1

sendMethod · 0.95

Calls 4

async_auth_flowMethod · 0.45
areadMethod · 0.45
acloseMethod · 0.45

Tested by

no test coverage detected