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

Method send_request

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

Send a pre-built HTTP request and return status + body bytes.

(
        &self,
        req: Request<Full<Bytes>>,
        timeout: Duration,
    )

Source from the content-addressed store, hash-verified

315
316 /// Send a pre-built HTTP request and return status + body bytes.
317 async fn send_request(
318 &self,
319 req: Request<Full<Bytes>>,
320 timeout: Duration,
321 ) -> Result<(hyper::StatusCode, Bytes), PodmanApiError> {
322 let mut sender = self.connect().await?;
323 let response = tokio::time::timeout(timeout, sender.send_request(req))
324 .await
325 .map_err(|_| PodmanApiError::Timeout(timeout))?
326 .map_err(|e| PodmanApiError::Connection(e.to_string()))?;
327 let status = response.status();
328 let bytes = tokio::time::timeout(timeout, response.into_body().collect())
329 .await
330 .map_err(|_| PodmanApiError::Timeout(timeout))?
331 .map_err(|e| PodmanApiError::Connection(e.to_string()))?
332 .to_bytes();
333 Ok((status, bytes))
334 }
335
336 /// Perform a versioned HTTP request and return status + body bytes.
337 async fn request(

Callers 11

proxy_to_endpointFunction · 0.80
http1_getFunction · 0.80
http_get_jsonFunction · 0.80
http_getFunction · 0.80
requestMethod · 0.80
pingMethod · 0.80
events_streamMethod · 0.80
http_get_jsonFunction · 0.80

Calls 1

connectMethod · 0.45

Tested by 6

http_get_jsonFunction · 0.64
http_getFunction · 0.64
http_get_jsonFunction · 0.64