Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p><code>GET</code> and <code>POST</code> are two different types of HTTP requests.</p> <p>According to <a href="http://en.wikipedia.org/wiki/Hypertext_Transfer_Protocol" rel="noreferrer">Wikipedia</a>:</p> <blockquote> <p><b>GET</b> requests a representation of the specified resource. Note that GET should not be used for operations that cause side-effects, such as using it for taking actions in web applications. One reason for this is that GET may be used arbitrarily by robots or crawlers, which should not need to consider the side effects that a request should cause.</p> </blockquote> <p>and </p> <blockquote> <p><b>POST</b> submits data to be processed (e.g., from an HTML form) to the identified resource. The data is included in the body of the request. This may result in the creation of a new resource or the updates of existing resources or both.</p> </blockquote> <p>So essentially <code>GET</code> is used to retrieve remote data, and <code>POST</code> is used to insert/update remote data.</p> <p><hr /> HTTP/1.1 specification (RFC 2616) section 9 <a href="http://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9" rel="noreferrer"><b>Method Definitions</b></a> contains more information on <code>GET</code> and <code>POST</code> as well as the other HTTP methods, if you are interested.</p> <p>In addition to explaining the intended uses of each method, the spec also provides at least one practical reason for why <code>GET</code> should only be used to retrieve data:</p> <blockquote> <p>Authors of services which use the HTTP protocol SHOULD NOT use GET based forms for the submission of sensitive data, because this will cause this data to be encoded in the Request-URI. Many existing servers, proxies, and user agents will log the request URI in some place where it might be visible to third parties. Servers can use POST-based form submission instead</p> </blockquote> <p><hr /> Finally, an important consideration when using <code>GET</code> for AJAX requests is that some browsers - IE in particular - will cache the results of a <code>GET</code> request. So if you, for example, poll using the same <code>GET</code> request you will always get back the same results, even if the data you are querying is being updated server-side. One way to alleviate this problem is to make the URL unique for each request by appending a timestamp.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload