Web APIs
Response.text()
Consume the body and decode it as UTF-8 text. Reading the same consumed body again fails; clone first if independent reads are required. Example console output: ready true.
Formal Syntax & Structure
javascript syntaxjavascript
response.text()Return Value
Promise<string>
Decoded text.
Working Example
Example Snippetjavascript
(async () => {const response=new Response("ready"); console.log(await response.text(),response.bodyUsed);})()