I'm writing a web app with node/express and I'm trying to set up some restful routes. Basically I have some generic items
and I have a page that has a list of these items. so I've set up the following route:
router.get('/items')...
I'm currently setting up add/update
items as well, but I'm not sure if I should set up a PUT
for add and POST
for update, or use POST
for both? I've read that POST
is acceptable for both add/update, but if I use post for add and update, then I have to use the same route, is this correct? Which would mean I have to pass back some sort of 'action' parameter to tell the route what action to take.
is this a situation where I should use PUT
and POST
separately?