The Difference Between Get and Post Requests

When requesting a document, it is possible for the web client (or browser) to request additional information or send information to the web server using either Get or Post requests. In a Get request, data is appended to the tail of a URL in the form of a query string, like this:

http://google.com/search?q=html5

This URL directly sends the search lookup string of html5 to the Google web servers by passing it as a string value in the argument q. When Google sees this request, it knows to return to you all the pages it thinks are relevant to the request. A longer such request might look like the following, in which the + symbol is used in place of spaces:

http://google.com/search?q=html5+course

Here the search string html5 course is passed to Google. In a Post request, however, the additional information is passed from the client to the server in the headers, which is neater as far as the user goes, because it does not appear as part of the URL. Both get and post requests are discussed in detail later in this book.

The Difference Between Get and Post Requests

No comments:

Post a Comment