The fetch method resolves a response object. This is similar to the request object, with a few differences. It represents a server response for a request.
The response object has the following properties:
- headers: The headers object
- ok: Indicates if the status in in the 200-299 range
- redirected: Indicates if the response is from a redirect
- status: The HTTP status code, for example, 200 for good
- statusText: The status message of the corresponding code
- type: The type of response, for example, cors or basic
- url: The response URL
- bodyUsed: A Boolean indicating whether the body has been used
There are several methods you should also know about:
- clone: Makes a clone of the response object
- arrayBuffer: Returns a promise that ...