Response: Response() constructor

The Response() constructor creates a new Response object.


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


body Optional

An object defining a body for the response. This can be null (which is the default value), or one of:

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:


The status code for the response, e.g., 200.


The status message associated with the status code, e.g., OK.


Any headers you want to add to your response, contained within a Headers object or object literal of String key/value pairs (see HTTP headers for a reference).


In our Fetch Response example (see Fetch Response live) we create a new Response object using the constructor, passing it a new Blob as a body, and an init object containing a custom status and statusText:

const myBlob = new Blob();
const myOptions = { status: 200, statusText: "SuperSmashingGreat!" };
const myResponse = new Response(myBlob, myOptions);


Fetch Standard
# ref-for-dom-response①

Browser compatibility

BCD tables only load in the browser

See also