Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/xdg/vendor/types/deno.d.ts>fetch

Determine XDG Base Directory paths (OS/platform portable)
Go to Latest
function fetch
import { fetch } from "https://deno.land/x/xdg@v10.5.1/vendor/types/deno.d.ts";

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();

Parameters

input: Request | URL | string
optional
init: RequestInit