• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

EPractice Lab review quiz 3 : Delete vs POST

 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Which of the following HTTP methods is used to remove an article from a virtual shopping cart in a web application?
Given answer: POST


I think the answer should be DELETE, not POST.
 
Les Morgan
Rancher
Posts: 710
17
C++ Java MySQL Database Netbeans IDE Oracle Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
the assumption would be made that the virtual shopping cart has reserves into the stock, so there is a virtual hold on items. To remove these holds and free up the resources in the DB, you would need to do a post with instructions for a delete action. So in essence post a negative transaction.
Himai Minh wrote:

Which of the following HTTP methods is used to remove an article from a virtual shopping cart in a web application?
Given answer: POST


I think the answer should be DELETE, not POST.
 
Himai Minh
Ranch Hand
Posts: 1360
7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I guess the reason why POST is chosen instead of DELETE is because when DELETE is used, we have to provide the URI of the resource to be removed.
Since we don't know the URI of the items to be removed in this shopping cart application, we use POST to remove the item from the DB.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic