Fetch Flashcards
1
Q
What does fetch()
return?
A
returns a promise
2
Q
What is the default request method used by fetch()
?
A
a GET request
3
Q
How do you specify the request method (GET
, POST
, etc.) when calling fetch
?
A
in the second parameter of the fetch method which is an object that holds various properties and methods for you to customize the type of request you are making
4
Q
How does fetch
report errors?
A
through the use of Response.ok property and throwing a new Error when that value is false