HTTP: The Definitive Guide
by David Gourley, Brian Totty, Marjorie Sayer, Anshu Aggarwal, Sailu Reddy
Transactions
Let’s look in more detail how clients use HTTP to transact with web servers and their resources. An HTTP transaction consists of a request command (sent from client to server), and a response result (sent from the server back to the client). This communication happens with formatted blocks of data called HTTP messages , as illustrated in Figure 1-5.

Figure 1-5. HTTP transactions consist of request and response messages
Methods
HTTP supports several different request commands, called HTTP methods . Every HTTP request message has a method. The method tells the server what action to perform (fetch a web page, run a gateway program, delete a file, etc.). Table 1-2 lists five common HTTP methods.
Table 1-2. Some common HTTP methods
|
HTTP method |
Description |
|---|---|
|
GET |
Send named resource from the server to the client. |
|
PUT |
Store data from client into a named server resource. |
|
DELETE |
Delete the named resource from a server. |
|
POST |
Send client data into a server gateway application. |
|
HEAD |
Send just the HTTP headers from the response for the named resource. |
We’ll discuss HTTP methods in detail in Chapter 3.
Status Codes
Every HTTP response message comes back with a status code. The status code is a three-digit numeric code that tells the client if the request succeeded, or if other actions are required. A few common status codes are shown in Table 1-3.
Table 1-3. Some common HTTP ...