Skip to main content

http_request

Function http_request 

Source
pub fn http_request(
    egress: Option<&Arc<dyn HttpEgress>>,
    caps: &CapabilitySet,
    url: &str,
    body: Option<&[u8]>,
    traceparent: Option<&str>,
) -> Result<HttpResponse, HttpPolicyError>
Expand description

Run a capability-gated HTTP request: allow-list check, egress presence, timeout resolution, dispatch, then the >= 400 status gate.

body present selects POST, absent selects GET. traceparent is the host’s active W3C trace context, threaded through as a parameter rather than read from ambient state so the dispatch stays unit-testable.

§Errors

Returns HttpPolicyError for each refusal reason; see its variants.