Win a copy of AWS Security this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Jeanne Boyarsky
  • Junilu Lacar
  • Henry Wong
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Frits Walraven
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • salvin francis
  • fred rosenberger

EPractice Lab review quiz 3 : Delete vs POST

 
Ranch Foreman
Posts: 1906
13
  • 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.
 
Rancher
Posts: 895
22
Netbeans IDE Oracle MySQL Database Tomcat Server C++ Java
  • 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 Foreman
Posts: 1906
13
  • 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.
 
He loves you so much! And I'm baking the cake! I'm going to put this tiny ad in the cake:
Devious Experiments for a Truly Passive Greenhouse!
https://www.kickstarter.com/projects/paulwheaton/greenhouse-1
    Bookmark Topic Watch Topic
  • New Topic