Back
Syntax
Study
Editor
Mode:
HTML
CSS
JavaScript
PHP
Reset
Run »
HTML / CSS / JS
const headers = new Headers({ "Content-Type": "application/json", "Authorization": `Bearer ${token}`, }); headers.append("X-Request-Id", crypto.randomUUID()); const res = await fetch("/api/data", { headers }); res.headers.forEach((val, name) => console.log(name, val));
Result
Open