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

Method _send_handling_auth

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

Source from the content-addressed store, hash-verified

928 raise exc
929
930 def _send_handling_auth(
931 self,
932 request: Request,
933 auth: Auth,
934 follow_redirects: bool,
935 history: list[Response],
936 ) -> Response:
937 auth_flow = auth.sync_auth_flow(request)
938 try:
939 request = next(auth_flow)
940
941 while True:
942 response = self._send_handling_redirects(
943 request,
944 follow_redirects=follow_redirects,
945 history=history,
946 )
947 try:
948 try:
949 next_request = auth_flow.send(response)
950 except StopIteration:
951 return response
952
953 response.history = list(history)
954 response.read()
955 request = next_request
956 history.append(response)
957
958 except BaseException as exc:
959 response.close()
960 raise exc
961 finally:
962 auth_flow.close()
963
964 def _send_handling_redirects(
965 self,

Callers 1

sendMethod · 0.95

Calls 5

sync_auth_flowMethod · 0.45
sendMethod · 0.45
readMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected