MCPcopy Create free account
hub / github.com/NVIDIA/OpenShell / send_backend_request

Function send_backend_request

crates/openshell-router/src/backend.rs:339–354  ·  view source on GitHub ↗

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,
)

Source from the content-addressed store, hash-verified

337/// The timeout covers the entire request lifecycle (connect + headers + body).
338/// Suitable for non-streaming responses where the body is buffered completely.
339async 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///

Callers 2

try_validation_requestFunction · 0.85
proxy_to_backendFunction · 0.85

Calls 2

prepare_backend_requestFunction · 0.85
map_send_errorFunction · 0.85

Tested by

no test coverage detected