Skip to main content

start_fetch

Function start_fetch 

Source
pub unsafe fn start_fetch(
    cx: *mut JSContext,
    promise_val: Value,
    profile: Option<StealthProfile>,
    method: Method,
    url: String,
    headers: Vec<(String, String)>,
    body: Option<Vec<u8>>,
    abort: Option<AbortRequest>,
    tls: Option<FetchTlsInit>,
)
Expand description

fetch()-native entry: WHATWG fetch(input, init) with both optional channels โ€” init.signal (abort) and init.tls (undici dispatcher tls subset, see FetchTlsInit). start/start_with_signal are the Node-API entries (http/https/http2) and carry no per-fetch tls options.

ยงSafety

  • cx must be a live JSContext* on the current thread.
  • promise_val must be an Object JSVal holding a pending Promise.