Open Laboratory for Technocrats

Grab the developer role, learn concepts & prepare with senior software engineers to get solutions for problems in a software job. Coding and Programming Solutions crafted for you.

Difference between POST and GET Methods in HTML with Example

POST and GET


While creating forms in HTML every one gets at these two methods generally.
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


When data is sent to server through GET then it is appended to the URL and it is visible in URL. It is not safe to use sensitive data through GET. Example like this:

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.
First name:
Last name:
 

POST


 When we send data through post then it is sent through the body. It is good to use for sensitive and safer data. Data is secured in 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.

    First name:
    Last name:






    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.

    Top #3 Articles