Web APIs
Response.bodyUsed
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.bodyUsedReturn 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);}})()