Build and send an HTTP request to the backend with a total request timeout. The timeout covers the entire request lifecycle (connect + headers + body). Suitable for non-streaming responses where the body is buffered completely.
(
client: &reqwest::Client,
route: &ResolvedRoute,
method: &str,
path: &str,
headers: &[(String, String)],
body: bytes::Bytes,
)
| 337 | /// The timeout covers the entire request lifecycle (connect + headers + body). |
| 338 | /// Suitable for non-streaming responses where the body is buffered completely. |
| 339 | async fn send_backend_request( |
| 340 | client: &reqwest::Client, |
| 341 | route: &ResolvedRoute, |
| 342 | method: &str, |
| 343 | path: &str, |
| 344 | headers: &[(String, String)], |
| 345 | body: bytes::Bytes, |
| 346 | ) -> Result<reqwest::Response, RouterError> { |
| 347 | let (builder, url) = |
| 348 | prepare_backend_request(client, route, method, path, headers, body, false)?; |
| 349 | builder |
| 350 | .timeout(route.timeout) |
| 351 | .send() |
| 352 | .await |
| 353 | .map_err(|e| map_send_error(e, &url)) |
| 354 | } |
| 355 | |
| 356 | /// Build and send an HTTP request without a total request timeout. |
| 357 | /// |
no test coverage detected