HTTP Request Types
The request
type is passed by the client to the server to indicate what the
server should do with the URL that's also supplied by the
browser. Although the HTTP specification details a number of request
types, like PUT and DELETE,
only two are supported by all servers and in common use:
GET
and POST. A
GET request asks the server to "get" a
piece of information, typically a document, and return it to the
client. If the request includes any additional information, these are
appended as arguments to the URL. A POST request,
on the other hand, provides the server with information to be
"posted" to the URL; typically, it's used to send
the contents of an HTML form to the server, or to provide the server
with information that's needed for back-end processing. The
information itself is contained in the body of the request.
Most servers cannot handle data received from either the
POST or GET methods internally.
Normally, POST requests, as well as
GET requests that also send data to the server,
are handled by accessory programs or DLLs (CGI and ISAPI applications
and ISAPI filters). Both POST and
GET requests can return any kind of data of any
size.
While it may seem when transmitting data to a web server that
GET and POST are similar, one
rule is hard and fast: A GET request must never change
anything. Don't write an ASP script that makes
changes to a database, for instance, in response to a GET request.
The reason for this is discussed in greater detail in Section ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access