POST and GET
What are these two methods?
Let's discuss a little about it here in this post about the difference between the POST and GET Methods in HTML with Example.
Both are used to submit form data but the difference is how the data is sent to the server? Let's explore it a little.
After creating an HTML form every one goes to the step next as submit the form here we have to use the method in the form tag as "get" type
GET
www.opentechlabs.blogspot.com/?login=xyz@hotmail.com&password=hurray
- They can be bookmarked.
- They don't make any harm while reloading the page or using the back button on the browser.
- They can be cached in the browser.
- They can be easily stored for further use by the browser or human.
- They have a fixed length of URL that is 2048 characters.
- They only allow ASCII characters.
- They show what they are holding while moving from one page to another page.
- They are less secure than other methods.
- They allow 7607 characters maximum size.
POST
- They can not be bookmarked.
- They can make resubmission of data by reloading but the browser will ask for confirmation.
- They can not be cached in the browser.
- They are not stored in the browser.
- They don't have any restrictions on character length.
- They allow all type of data even binary is also allowed.
- They are a little bit more secure than get but not enough.
- They allow 8 Mb max size for data.
A video that found these things explanatory with working examples along with PHP
So in this post, we learnt when to use get and post along with the difference between get and post methods in HTML with example.