Skip to main content
Version: 0.5.11

Response()

The Response() constructor creates a new Response object.

Syntax

new Response()
new Response(body)
new Response(body, options)

Parameters

  • body optional

  • options optional

    • : An options object containing any custom settings that you want to apply to the response, or an empty object (which is the default value). The possible options are:

      • status
        • : The status code for the response, e.g., 200.
      • statusText
        • : The status message associated with the status code, e.g., OK.
      • headers
        • : Any headers you want to add to your response, contained within a Headers object or object literal of String key/value pairs.