'When to use app.get("/",fun(res,req)) and app.post("/",fun(res,req)) in node.js?

I am newbie in backend. I need your help. Actually I am confused between app.get() and app.post(). Also when to use them? So pls give me answer in a simple way with examples.

Thank U in advance...!!!!



Solution 1:[1]


Hi, in API we use


  1. GET to get data
  2. POST to add data
  3. PUT to edit data
  4. PATCH to edit data
  5. DELETE to delete data

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Kareem Adel