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...!!!!
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...!!!!
When using the HTTP protocol, we use different URLs to retrieve, add, update or delete information. To specify which action we want to perform we add to the URL the HTTP method (also called as HTTP verb).
2 popular HTTP verbs are:
In ExpressJS framework we register a handler function (known as a middleware) for each possible route that our app should handle.
to register a handler function to a route that uses the GET method, we use:
.get(<route>, <middleware>)
and to register a handler function to a route that uses the POST method, we use:
.post(<route>, <middleware>)