Overview of Hypertext Transfer Protocol

Robert D. Cameron
January 28, 2004

HTTP/1.1

HTTP/1.1 is the current, stable version of Hypertext Transfer Protocol as defined in RFC 2616 of the Internet Engineering Task Force (June 1999).

I. Request/Response Client/Server Protocol

HTTP operates through the exchange of messages:

Client HTTP Request Message ->
<- HTTP Response Message
Server

Statelessness

HTTP is fundamentally a stateless protocol.

Intermediaries: Proxies, Tunnels, Gateways

HTTP messages may go through a number of intermediaries. Requests and responses may be modified along the way.

Client HTTP Request Message ->
<- (Modified) HTTP Response Message
Proxy (Modified) HTTP Request Message ->
<- HTTP Response Message
Tunnel HTTP Request Message ->
<- (Modified) HTTP Response Message
Gateway (Modified) HTTP Request Message ->
<- HTTP Response Message
Server
Proxy
Tunnel
Gateway

Connections

Under HTTP/1.0, a separate TCP connection was generally established for each request/response interchange.

HTTP/1.1 permits and encourages continuous connections for a series of request/response interchanges. This increases communication efficiency.

Pipelining is also supported: clients may send multiple requests without waiting for responses.

II. Requests

The basic structure of an HTTP request is composed of five elements.

GET Requests

The GET request is the basic method to retrieve content associated with a URI.

HEAD Requests

The HEAD request is a partial GET that retrieves only the response headers associated with request. No message body is to be returned.

POST Requests

The POST request is the basic mechanism for uploading data to be associated with a particular URI. It is often used with HTML forms to send data from the client to the server.

PUT and DELETE Requests

HTTP also provides two lesser used requests related to modification of web content. Most web services do not support these methods.

Other Methods: OPTIONS, TRACE, CONNECT

The OPTIONS, TRACE and CONNECT methods support various control mechanisms associated with the communication process.

These methods are not typically invoked by user actions.

III. Responses

The basic structure of an HTTP response is composed of four elements.

Response Codes

Response codes are organized into five classes.

Redirection

Redirection is a crucial feature of HTTP that requests the client to automatically reissue a request to a different URI.

Time delays can be inserted with the Retry-After header.

Content-Type

Content-type is a key header that tells the client what type of content the server is sending back.