async fn async_http_client_with_headers(
oauth_request: HttpRequest,
) -> Result<HttpResponse, HttpClientError<Error>>
Expand description
HTTP Client used only for authenticating with TMC server. This function:
- Ensures TMC server does not rate limit auth requests from backend by adding a special header
- Converts between oauth2 crate’s internal http types and our reqwest types:
- Converts oauth2::HttpRequest to a reqwest::Request
- Makes the request using our REQWEST_CLIENT
- Converts the reqwest::Response back to oauth2::HttpResponse