deno_fetch
This crate implements the Fetch API.
Spec: https://fetch.spec.whatwg.org/
Usage Example
From javascript, include the extension's source, and assign the following properties to the global scope:
import from "ext:core/mod.js";
const headers = core.;
const formData = core.;
const request = core.;
const response = core.;
const fetch = core.;
const eventSource = core.;
// Set up the callback for Wasm streaming ops
core.;
Object.;
Object.;
Object.;
Object.;
Object.;
Then from rust, provide deno_fetch::deno_fetch::init(Default::default()) in
the extensions field of your RuntimeOptions
Where:
- Options:
deno_fetch::Options, which implementsDefault
Dependencies
- deno_webidl: Provided by the
deno_webidlcrate - deno_web: Provided by the
deno_webcrate - deno_console: Provided by the
deno_consolecrate
Provided ops
Following ops are provided, which can be accessed through Deno.ops:
- op_fetch
- op_fetch_send
- op_utf8_to_byte_string
- op_fetch_custom_client
- op_fetch_promise_is_settled