MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / send_request_with

Method send_request_with

tests/all/cli_tests.rs:1658–1674  ·  view source on GitHub ↗
(
            send: &mut hyper::client::conn::http1::SendRequest<String>,
            req: http::Request<String>,
        )

Source from the content-addressed store, hash-verified

1656 }
1657
1658 async fn send_request_with(
1659 send: &mut hyper::client::conn::http1::SendRequest<String>,
1660 req: http::Request<String>,
1661 ) -> Result<http::Response<String>> {
1662 let response = send
1663 .send_request(req)
1664 .await
1665 .context("error sending request")?;
1666
1667 let (parts, body) = response.into_parts();
1668
1669 let body = body.collect().await.context("failed to read body")?;
1670 assert!(body.trailers().is_none());
1671 let body = std::str::from_utf8(&body.to_bytes())?.to_string();
1672
1673 Ok(http::Response::from_parts(parts, body))
1674 }
1675
1676 async fn start_requests(
1677 &self,

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
collectMethod · 0.80
contextMethod · 0.45
send_requestMethod · 0.45
into_partsMethod · 0.45
to_stringMethod · 0.45
to_bytesMethod · 0.45

Tested by

no test coverage detected