Model Forms (Get and Post)

When do we use GET and when do we use POST in the forms? what is the difference between them?

Hey,
Both GET and POST are the methods to send a HTTP request, you can use any of these method to send your data from client to server. But there are some uses cases where we use POST or GET accordingly as there are some difference between these 2.
For eg. -

  • If you want to send username and password from client to server to check if user credentials are correct, you will always use POST method, since it is secure.
  • GET method display your data on url which is called (query string) therefore it is not advisable to use GET for sending sensitive information. Something like this
    url.com?username=value1&password=value2
    POST method always sends data on the body of the header therefore data is not displayed in the client.
  • Also GET method has a restriction on the length of data you can send, so if you want to send a whole page of a document in text format, you wont be able to do that with GET, whereas POST has no such restriction on length of data…

You can find more difference here

Happy Learning,

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.