rs ` ](/en-US/docs/Web/API/Request/headers) ). 
  * ` request-no-cors ` : guard for a headers object obtained from a request created with [ ` Request.mode ` ](/en-US/docs/Web/API/Request/mode) ` no-cors ` . 
  * ` response ` : guard for a headers object obtained from a response ( [ ` Response.headers ` ](/en-US/docs/Web/API/Response/headers) ). 
  * ` immutable ` : guard that renders a headers object read-only; mostly used for ServiceWorkers. 

**Note:** You may not append or set the ` Content-Length ` header on a guarded
headers object for a ` response ` . Similarly, inserting ` Set-Cookie ` into a
response header is not allowed: ServiceWorkers are not allowed to set cookies
via synthesized responses.

##  Response objects

As you have seen above, [ ` Response ` ](/en-US/docs/Web/API/Response)
instances are returned when ` fetch() ` promises are resolved.

The most common response properties you'll use are:

  * [ ` Response.status ` ](/en-US/docs/Web/API/Response/status) â An integer (default value 200) containing the response status code. 
  * [ ` Response.statusText ` ](/en-US/docs/Web/API/Response/statusText) â A string (default value ""), which corresponds to the HTTP status code message. Note that HTTP/2 [ does not support ](https://fetch.spec.whatwg.org/#concept-response-status-message) status messages. 
  * [ ` Response.ok ` ](/en-US/docs/Web/API/Response/ok) â seen in use above, this is a shorthand for checking that status is in the range 200-299 inclusive. This returns a boolean value. 

They can also be created programmatically via JavaScript, but this is only
really useful in [ ` ServiceWorkers ` ](/en-US/docs/Web/API/Service_Worker_API
"ServiceWorkers") , when you are providing a custom response to a received
request using a [ ` respondWith() ` ](/en-
US/docs/Web/API/FetchEvent/respondWith "respondWith\(\)") method:

js

    
    
    const myBody = new Blob();
    
    addEventListener("fetch", (event) => {
      // ServiceWorker intercepting a fetch
      event.respondWith(
        new Response(myBody, {
          headers: { "Content-Type": "text/plain" },
        }),
      );
    });
    

The [ ` Response() ` ](/en-US/docs/Web/API/Response/Response "Response\(\)")
constructor takes two optional arguments â a body for the response, and an
init object (similar to the one that [ ` Request() ` ](/en-
US/docs/Web/API/Request/Request "Request\(\)") accepts.)

**Note:** The static method [ ` error() ` ](/en-
US/docs/Web/API/Response/error_static "error\(\)") returns an error response.
Similarly, [ ` redirect() ` ](/en-US/docs/Web/API/Response/redirect_static
"redirect\(\)") returns a response resulting in a redirect to a specified URL.
These are also only relevant to Service Workers.

##  Body

Both requests and responses may contain body data. A body is an instance of
any of the following types:

  * [ ` ArrayBuffer ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/ArrayBuffer)
  * [ ` TypedArray ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/TypedArray) (Uint8Array and friends) 
  * [ ` DataView ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/DataView)
  * [ ` Blob ` ](/en-US/docs/Web/API/Blob)
  * [ ` File ` ](/en-US/docs/Web/API/File)
  * [ ` String ` ](/en-US/docs/Web/JavaScript/Reference/Global_Objects/String) , or a string literal 
  * [ ` URLSearchParams ` ](/en-US/docs/Web/API/URLSearchParams)
  * [ ` FormData ` ](/en-US/docs/Web/API/FormData)

The [ ` Request ` ](/en-US/docs/Web/API/Request) and [ ` Response ` ](/en-
US/docs/Web/API/Response) interfaces share the following methods to extract a
body. These all return a promise that is eventually resolved with the actual
content.

  * [ ` Request.arrayBuffer() ` ](/en-US/docs/Web/API/Request/arrayBuffer) / [ ` Response.arrayBuffer() ` ](/en-US/docs/Web/API/Response/arrayBuffer)
  * [ ` Request.blob() ` ](/en-US/docs/Web/API/Request/blob) / [ ` Response.blob() ` ](/en-US/docs/Web/API/Response/blob)
  * [ ` Request.formData() ` ]