Web APIs

Response.bodyUsed

Try the free JavaScript compiler

Reports whether the response body stream is disturbed. A locked stream may be unusable even if bodyUsed is false.

Formal Syntax & Structure

javascript syntaxjavascript
response.bodyUsed

Return Value

boolean

Whether the body has been disturbed.

Working Example

Example Snippetjavascript
(async () => {const r=new Response("bad-json");try{await r.json();}catch(e){console.log(e.name,r.bodyUsed);}})()
JavaScript Reference