Difference between GET and POST method of form submission.


Published on

Difference between GET and POST method of form submission

Published in: Technology
1 Comment
1 Like
  • If the processing of a form is idempotent (i.e. it has no lasting observable effect on the state of the world), then the form method should be GET. Many database searches have no visible side-effects and make ideal applications of query forms.
    - -

    If the service associated with the processing of a form has side effects (for example, modification of a database or subscription to a service), the method should be POST.

    The main thing to keep in mind as a programmer is that defining your form to use the GET method does not protect against causing changes. You could use a GET request to do pretty much the same thing as a POST query. It’s just that browsers are generally coded to expect that POST requests will be used for things that will cause changes – like placing an order, or writing to a database, etc . GET requests should be used for pure queries that don’t affect anything on the server. So, one should always remember not to use GET requests for any action that would cause a change on the server – like ordering a big screen tv
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide

Difference between GET and POST method of form submission.

  1. 1. Difference between GET and POST method of form submission.
  2. 2. <ul><li>GET method is designed for getting information (a document, a chart, or a database query) </li></ul><ul><li>POST method is designed for posting information </li></ul><ul><ul><li>a credit card number </li></ul></ul><ul><ul><li>some new chart data </li></ul></ul><ul><ul><li>Information that is to be stored in a database </li></ul></ul>
  3. 3. <ul><li>Although its designed for reading information, can include as part of the request some of its own information that better describes what to get. This information is passed as a sequence of characters appended to the request URL in what’s called a query string. </li></ul><ul><li>POST method uses a different technique to send information to the server because in some cases it may need to send megabytes of information. </li></ul>
  4. 4. <ul><li>Placing the extra information in the URL in this way allows the page to be book-marked or e-mailed like any other </li></ul><ul><li>A POST request passes all its data, of unlimited length, directly over the socket connection as part of its HTTP request body. </li></ul>
  5. 5. <ul><li>Because GET requests need to send large amounts of information, some server limit the length of URLs and query strings to about 240 characters. </li></ul><ul><li>POST request cannot be bookmarked or emailed or in some cases, even reloaded </li></ul>
  6. 6. <ul><li>REMEMBER: Get requests because they can be bookmarked so easily, should not be allowed to cause a change on the server for which the client could be held responsible. In other words, GET requests should not be used to place an order, update a database or take an explicit client action in any way. </li></ul><ul><li>Provides a bit of extra security when sending sensitive information because the server’s access log that records all URL accesses won’t record the submitted POST data. </li></ul>~~~~~~~~~The End~~~~~~~~~