Share
Explore

Regarding the Use of POST vs GET


In web development and API design, the choice between GET and POST (and other HTTP methods) is typically guided by the action's nature:
GET is used for retrieving data. It should be idempotent, meaning it doesn't change the state of the server.
POST is used for sending data to the server, like form submissions, which can change the server's state or create new resources.
In the context of logging in, a POST request is appropriate because you're submitting sensitive data (username and password) which should not be exposed in a URL (as would be the case with a GET request) and potentially alters the server's state (e.g., creating a session).
This is a common convention in web development, hence the use of POST for login routes.


GET Request sends data from FORM to SERVER via URL ENCODING
does URL ENCODING
image.png

POST ENCODING METHOD
POST sends form fields in key:value pair encoding format : But in the TCP PIPE / STD OUT to STD IN on the server

Want to print your doc?
This is not the way.
Try clicking the ⋯ next to your doc name or using a keyboard shortcut (
CtrlP
) instead.