deno / 1.23.2 / ~ / fetch.html /

fetch

Fetch a resource from the network. It returns a Promise that resolves to the Response to that Request, whether it is successful or not.

const response = await fetch("http://my.json.host/data.json");
console.log(response.status);  // e.g. 200
console.log(response.statusText); // e.g. "OK"
const jsonData = await response.json();
function fetch( input: URL | Request | string , init?: RequestInit) : Promise<Response>;
fetch( input: URL | Request | string , init?: RequestInit) : Promise<Response>

Parameters

input: URL | Request | string
init?: RequestInit optional

Return Type

Promise<Response>

© 2018–2022 the Deno authors
https://doc.deno.land/deno/stable/~/fetch