Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
const res = await fetch("https://api.example.com/users"); if (!res.ok) throw new Error(`HTTP ${res.status}`); const users = await res.json(); // Check status and content-type before parsing console.log(res.status, res.headers.get("content-type"));
Result
Open