MCPcopy Index your code
hub / github.com/NVIDIA/OpenShell / get

Function get

crates/openshell-server/src/http.rs:447–465  ·  view source on GitHub ↗
(router: Router, path: &str)

Source from the content-addressed store, hash-verified

445 }
446
447 async fn get(router: Router, path: &str) -> (StatusCode, serde_json::Value) {
448 let response = router
449 .oneshot(Request::get(path).body(Body::empty()).unwrap())
450 .await
451 .expect("router responds");
452 let status = response.status();
453 let bytes = response
454 .into_body()
455 .collect()
456 .await
457 .expect("collect body")
458 .to_bytes();
459 let body = if bytes.is_empty() {
460 serde_json::Value::Null
461 } else {
462 serde_json::from_slice(&bytes).expect("response is valid JSON")
463 };
464 (status, body)
465 }
466
467 /// Build a router whose state is driven by a `HealthState` we control,
468 /// so each handler-shape test can pin the exact mapping under test.

Calls 1

is_emptyMethod · 0.45

Tested by 2

test_auth_routerFunction · 0.68
test_ws_tunnel_routerFunction · 0.68