pub struct HttpCall<'a> {
pub upstream: Upstream<'a>,
pub headers: Vec<(&'a str, &'a [u8])>,
pub trailers: Vec<(&'a str, &'a [u8])>,
pub body: Option<&'a [u8]>,
pub timeout: Option<Duration>,
pub callback: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &HttpCallResponse)>>,
}Expand description
Outbound HTTP call
Fields§
§upstream: Upstream<'a>Upstream cluster to send the request to.
headers: Vec<(&'a str, &'a [u8])>All headers to be sent along with the request. The proxy may add additional headers.
This should include pseudo headers like :method and :path.
trailers: Vec<(&'a str, &'a [u8])>All trailers to be sent along with the request.
body: Option<&'a [u8]>An optional request body to send with the request.
timeout: Option<Duration>A timeout on waiting for a response. Default is 10 seconds.
callback: Option<Box<dyn FnOnce(&mut DowncastBox<dyn RootContext>, &HttpCallResponse)>>Callback to call when a response has arrived.