Dev HelpersOpen library
← Back

Parse a JSON response

Parse a JSON response. A self-contained example using the JavaScript runtime.

Open this example in the interactive library

Source code

const response = new Response(JSON.stringify({ ok: true }), {
  headers: { "Content-Type": "application/json" },
});
console.log(await response.json());

Sample output

{ ok: true }