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

Method build_request

crates/openshell-driver-podman/src/client.rs:300–314  ·  view source on GitHub ↗

Build an HTTP request from components.

(
        method: hyper::Method,
        path: &str,
        body: Full<Bytes>,
        content_type: Option<&str>,
    )

Source from the content-addressed store, hash-verified

298
299 /// Build an HTTP request from components.
300 fn build_request(
301 method: hyper::Method,
302 path: &str,
303 body: Full<Bytes>,
304 content_type: Option<&str>,
305 ) -> Request<Full<Bytes>> {
306 let mut builder = Request::builder()
307 .method(method)
308 .uri(format!("http://localhost{path}"))
309 .header("Host", "localhost");
310 if let Some(ct) = content_type {
311 builder = builder.header("Content-Type", ct);
312 }
313 builder.body(body).expect("valid request")
314 }
315
316 /// Send a pre-built HTTP request and return status + body bytes.
317 async fn send_request(

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected