Open In App

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

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

Syntax

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