Skip to main content

fetch_begin

Function fetch_begin 

Source
pub fn fetch_begin(
    method: &str,
    url: &str,
    content_type: &str,
    body: &[u8],
) -> u32
Expand description

Dispatch an HTTP request that streams its response back to the guest.

Returns a handle (> 0) that identifies the request for subsequent polls, or 0 if the host could not initialise the fetch subsystem. The call returns immediately — the request is driven by a background task.

Pass "" for content_type to omit the header, and &[] for body on requests without a payload.