debugFullResponse()function

debugFullResponse(response: Response): Promise<string>
ParamType
responseResponse
The Response to debug. required
Return
Promise<string>
A promise resolving to the status line, headers, and body as a string.

Debug a full Response as a string including its headers and body.

  • Clones the response before reading the body so the original response can still be parsed later.
  • Omits the headers section when there are no headers.
  • Omits the body section when the response body is empty.

Examples

await debugFullResponse(new Response("hi", { status: 200 })) // "200 \n\nhi"