开发者

How to implement delete api call

开发者 https://www.devze.com 2023-04-02 15:34 出处:网络
Currently I am implementing API calls using Servlet. Whenever there is a call to fetch data, I use doGet() (GET request).

Currently I am implementing API calls using Servlet.

  • Whenever there is a call to fetch data, I use doGet() (GET request).
  • To put data I use doPost() (POST request).

Fr开发者_如何学运维om reading the references, I got the idea to use POST whenever you change the database, and GET is simply for fetching the data.

I need to implement a call to delete an item from the database. Should I implement this with POST or GET?


Yes, use doPost(..). If you are making a REST API you can consider doDelete(..)

0

精彩评论

暂无评论...
验证码 换一张
取 消