What is the difference between POST and GET

I’ve never got the difference between app.post and app.get , what are the differences?

1 Like

I’ll try my best to explain this. Generally speaking:

GET requests are for when just want to retrieve a page. (get the contents of a page)

POST requests are for transferring data. When you submit your password to a website or upload an image to a website, you are using a POST request.

When you set app.post for a route, you are telling the code that the route in question can only accept POST requests.

A few others I should note:

PATCH requests are like POST requests, but they are for updating info.

OPTIONS requests are for getting the types of allowed requests on a website.

DELETE requests are for deleting data on a website.

CONNECT are used for retrieving a website from a proxy.

4 Likes

tl;dr: GET is get stuff, POST is post (send and receive) stuff

2 Likes

Thank you!

Does it matter what do I use?

If you are making a page that users will just browse, use GET. If you are making a login, use POST.

thank you !!!