O'Reilly logo

Isomorphic Go by Kamesh Balasubramanian

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Removing an item

For removing an item of a specific product type, and all quantities of it, from the shopping cart, we will register the /restapi/remove-item-from-cart endpoint:

r.Handle("/restapi/remove-item-from-cart", endpoints.RemoveItemFromShoppingCartEndpoint(env)).Methods("DELETE")

This endpoint will be handled by the RemoveItemFromShoppingCartEndpoint handler function. Again, note that we use the HTTP DELETE method when calling this endpoint since we are performing a mutating operation on the web server (removing a shopping cart item).

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required