Horje
Difference between GET and POST Methods in HTML Form

When you submit a form on a website, using the GET method puts the data in the web address. The POST method sends the data quietly in the background, like a secret message that’s not shown in the web address.

GET Method

  • Data in URL: GET sends form data as part of the URL and Information is visible in the browser’s address bar.
  • Bookmarking and Caching: Form submissions with GET can be bookmarked and cached easily and it is useful for sharing links but not suitable for sensitive data.
  • Limit on Data Size: Using GET Limited data size for submission (typically up to 2048 characters) and this is ideal for small amounts of non-sensitive data.

Syntax

<form action="/submit" method="GET">
<label for="username">Username:</label>
<input type="text" id="username" name="username">
<input type="submit" value="Submit">
</form>

POST Method

  • Data in Request Body: POST sends form data in the body of the HTTP request and Information is not visible in the URL.
  • Security and Sensitivity: It is suitable for sensitive data like passwords and it is more secure as data is not exposed in the URL.
  • No Data Size Limit: No strict size limit for data submission and it is suitable for large amounts of information.

Syntax

<form action="/submit" method="POST">
<label for="password">Password:</label>
<input type="password" id="password" name="password">
<input type="submit" value="Submit">
</form>



Reffered: https://www.geeksforgeeks.org


HTML

Related
How to use the target attribute in the &lt;a&gt; Tag in HTML ? How to use the target attribute in the &lt;a&gt; Tag in HTML ?
How to include External CSS in an HTML Document ? How to include External CSS in an HTML Document ?
What is the purpose of the colspan attribute in a HTML Table ? What is the purpose of the colspan attribute in a HTML Table ?
How do you create a numbered list in HTML 5 ? How do you create a numbered list in HTML 5 ?
Explain the difference between head Tag and header Tag in HTML5 ? Explain the difference between head Tag and header Tag in HTML5 ?

Type:
Geek
Category:
Coding
Sub Category:
Tutorial
Uploaded by:
Admin
Views:
17