const myHeaders = new Headers();
myHeaders.append("Content-Type", "text/xml");
myHeaders.get("Content-Type"); // should return 'text/xml'Headers / notebook
Headers
Runnable notebook: every JavaScript, HTML and CSS example on this page executes in a sandboxed local frame. Nothing leaves the browser.
let myHeaders = new Headers({
"Content-Type": "text/xml",
});
// or, using an array of arrays:
myHeaders = new Headers([["Content-Type", "text/xml"]]);
myHeaders.get("Content-Type"); // should return 'text/xml'