I am current writing an API layer for my project, and am struggling with trying to figure out a good design approach for the following scenario:
Currently, I'm not sure which the best approach would be:
1) PUT - /api/list/{listID}/{bookID} - Add book to specified list
DELETE - /api/list/{listID}/{bookID} - Remove book from specified list
2) PUT - /api/list/{listID} - Send XML data to server that contains bookID and action
<list_payload>
<action>{delete|add}</action>
<bookID>{bookID}</bookID>
</list_payload>
Any insight would be appreciated.
I think like this
1)POST - /api/lists/{listID}/books - Add book to specified list
2)PUT - /api/lists/{listID}/books/{bookID} - Edit book from a specified list
3)DELETE - /api/lists/{listID}/books/{bookID} - delete
for List
POST - /api/lists Add list
PUT - /api/lists/{listID} Edit list
DELETE /api/lists/{listID} Delete list
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With