Skip to main content
fixed typos
Source Link
Tobias F.
  • 1k
  • 1
  • 11
  • 27

Its basically a matter of what they are used for. If you want to e.g. create something new or upload a file you shoulshould use a POST request. If you want to get Information from the Server, which is already there (e.g. data from a database) you should use GET.

To sum it up in short: Use POST for sending data and GET to receive data from the server.

For your form: you have to specify which request method should be used:

<html> // Use GET <form action="form.php" method="GET"> <input type="text" name="text"> <button type="submit">Submit</button> </form> // Use POST <form action="form.php" method="POST"> <input type="text" name="text"> <button type="submit">Submit</button> </form> </html> 

Its basically a matter of what they are used for. If you want to e.g. create something new or upload a file you shoul use a POST request. If you want to get Information from the Server, which is already there (e.g. data from a database) you should use GET.

To sum it up in short: Use POST for sending data and GET to receive data from the server.

Its basically a matter of what they are used for. If you want to e.g. create something new or upload a file you should use a POST request. If you want to get Information from the Server, which is already there (e.g. data from a database) you should use GET.

To sum it up in short: Use POST for sending data and GET to receive data from the server.

For your form: you have to specify which request method should be used:

<html> // Use GET <form action="form.php" method="GET"> <input type="text" name="text"> <button type="submit">Submit</button> </form> // Use POST <form action="form.php" method="POST"> <input type="text" name="text"> <button type="submit">Submit</button> </form> </html> 
Source Link
Tobias F.
  • 1k
  • 1
  • 11
  • 27

Its basically a matter of what they are used for. If you want to e.g. create something new or upload a file you shoul use a POST request. If you want to get Information from the Server, which is already there (e.g. data from a database) you should use GET.

To sum it up in short: Use POST for sending data and GET to receive data from the server.