Handling HTTP request Flashcards
What is the format for API URLs?
/api/version/resource_name
What is the method used to add a piece of data?
POST request
What is the status code for a POST request?
201
What is the method for reading data?
GET request
What is the status code for reading data?
200
What is the method for updating a piece of data?
PATCH or PUT
What is the status code for PATCH or PUT requests?
200
What is the method used for deleting a piece of data?
DELETE
What is the status code for DELETE requests?
204
What is the status code for an internal server error?
500
What is the status code for a bad request?
400
Which middleware is used to parse a request body?
app.use(express.json());
How do you merge objects with vanilla JavaScript?
Object.assign(obj1, obj2)