Handling HTTP request Flashcards

1
Q

What is the format for API URLs?

A

/api/version/resource_name

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

What is the method used to add a piece of data?

A

POST request

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

What is the status code for a POST request?

A

201

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

What is the method for reading data?

A

GET request

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

What is the status code for reading data?

A

200

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

What is the method for updating a piece of data?

A

PATCH or PUT

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

What is the status code for PATCH or PUT requests?

A

200

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

What is the method used for deleting a piece of data?

A

DELETE

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

What is the status code for DELETE requests?

A

204

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

What is the status code for an internal server error?

A

500

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

What is the status code for a bad request?

A

400

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

Which middleware is used to parse a request body?

A

app.use(express.json());

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

How do you merge objects with vanilla JavaScript?

A

Object.assign(obj1, obj2)

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