MCPcopy Create free account
hub / github.com/bytecodealliance/wstd / http_echo_headers

Function http_echo_headers

examples/http_server.rs:95–99  ·  view source on GitHub ↗
(request: Request<Body>)

Source from the content-addressed store, hash-verified

93}
94
95async fn http_echo_headers(request: Request<Body>) -> Result<Response<Body>> {
96 let mut response = Response::builder();
97 *response.headers_mut().unwrap() = request.into_parts().0.headers;
98 Ok(response.body("".to_owned().into())?)
99}
100
101async fn http_echo_trailers(request: Request<Body>) -> Result<Response<Body>> {
102 let collected = request.into_body().into_boxed_body().collect().await?;

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected