Skip to main content
function 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("");
console.log(response.status);  // e.g. 200
console.log(response.statusText); // e.g. "OK"
const jsonData = await response.json();


input: Request | URL | string
init: RequestInit