Difference between get and post methods

You are currently viewing Difference between get and post methods

Difference between get and post methods

The Get and Post methods in php are two methods that are commonly used to submit data from a web form to a server-side script for processing. The GET method is used to retrieve data from the server and display it in the browser, while the POST method is used to send data to the server for processing. GET sends data in the URL as a query string, while POST sends data in the request body. GET is useful for retrieving data, while POST is more secure and used for submitting sensitive information like login credentials.

Sr. NoGet MethodPost Method
1.When using GET, data parameters are included in the URL and visible to everyone.When using POST, data is not displayed in the URL but in the HTTP message body.
2.GET request is comparatively less secure because the data is exposed in the URL barPOST request is comparatively more secure because the data is not exposed in the URL bar.
3.Request made through GET method are stored in Browser history.Request made through POST method is not stored in Browser history.
4.The GET method supports only string data typesWhile the POST method supports different data types such as string, numeric, binary, and so on.
5.Data passed through GET method can be easily stolen by attackers.Data passed through POST method can not be easily stolen by attackers.
6.GET method request can be saved as bookmark in browser.POST method request can not be saved as bookmark in browser.
7.In GET method we can not send large amount of data rather limited data is sent because the request parameter is appended into the URL.In POST method large amount of data can be sent because the request parameter is appended into the body.

Leave a Reply