Fetch Flashcards

1
Q

What does fetch() return?

A

returns a promise

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the default request method used by fetch()?

A

a GET request

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly