MCPcopy
hub / github.com/authlib/authlib / _http_request

Function _http_request

authlib/integrations/base_client/async_app.py:137–152  ·  view source on GitHub ↗
(ctx, session, method, url, token, kwargs)

Source from the content-addressed store, hash-verified

135
136
137async def _http_request(ctx, session, method, url, token, kwargs):
138 request = kwargs.pop("request", None)
139 withhold_token = kwargs.get("withhold_token")
140 if ctx.api_base_url and not url.startswith(("https://", "http://")):
141 url = urlparse.urljoin(ctx.api_base_url, url)
142
143 if withhold_token:
144 return await session.request(method, url, **kwargs)
145
146 if token is None and ctx._fetch_token and request:
147 token = await ctx._fetch_token(request)
148 if token is None:
149 raise MissingTokenError()
150
151 session.token = token
152 return await session.request(method, url, **kwargs)

Callers 2

requestMethod · 0.85
requestMethod · 0.85

Calls 4

MissingTokenErrorClass · 0.85
getMethod · 0.45
requestMethod · 0.45
_fetch_tokenMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…