(ctx, session, method, url, token, kwargs)
| 135 | |
| 136 | |
| 137 | async 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) |
no test coverage detected
searching dependent graphs…