Fetch API Flashcards
What is a Fetch API?
An interface for fetching resources.
What does fetch return
promises
What does Fetch make things easier?
It makes it easier to make web requests and handle responses.
Fetch makes it easier to make web requests and handle responses than with the older __________.
XMLHttpRequest
What is the one mandatory argument, the fetch() method takes?
The path to the resource you want to fetch.
A fetch() method returns a _______ that resolves to the _____ to that request, whether it is successful or not.
Promise, Response
fetch()
The fetch() method used to fetch a resource
Headers
Represents response/request headers, allowing you to query them and take different actions depending on the results.
Request
Represents a resource request
Response
Represents the response to a request
Body
Provides methods relating to the body of the response/request, allowing you to declare what its content type is and how it should be handled.