pub fn dispatch_http_call<K1, V1, K2, V2, B>(
upstream: &str,
headers: &[(K1, V1)],
body: Option<B>,
trailers: &[(K2, V2)],
timeout: Duration,
) -> Result<u32>Expand description
Dispatches an HTTP call to a given upstream.
ยงExamples
use std::time::Duration;
use proxy_wasm::hostcalls;
let request_handle = hostcalls::dispatch_http_call(
"cluster_name",
&vec![
(":method", "POST"),
(":path", "/stuff"),
],
Some("hi there!"),
hostcalls::NO_TRAILERS,
Duration::from_secs(10),
)?;