ThePlace

Home ] Search ] Resources ] Site Map ] Contact Me ]
Dave's Information Technology Resource

Up ]

Network Technologies ] TCP/IP ] [ HTTP Defined ] Web Servers ] Web Hosting Options ]

--- HTTP Defined ---

HTTP: HyperText Transport Protocol

A top-level view of how HTTP works:

The following is a summary of web server operations as originally defined in the HTTP specification.

Terminology (adapted from RFC 2616)

bulletConnection: A transport layer virtual circuit/connection established between two programs for the purpose of communication.
bulletMessage: The basic unit of HTTP communication, consisting of a structured sequence of octets matching the syntax defined in section 4 and transmitted via the connection.
bulletRequest: An HTTP request message that sends information from the browser to the server.
bulletResponse: An HTTP response message containing information for the client (usually in HTML/MIME format).
bulletClient: A program that establishes connections for the purpose of sending requests.
bulletUser agent: The client which initiates a request. These are often browsers, editors, spiders (web-traversing robots), or other end user tools.
bulletServer: An application program that accepts connections in order to service requests by sending back responses. Any given program may be capable of being both a client and a server; our use of these terms refers only to the role being performed by the program for a particular connection, rather than to the program's capabilities in general. Likewise, any server may act as an origin server, proxy, gateway, or tunnel, switching behavior based on the nature of each request.
bulletProxy: An intermediary program which acts as both a server and a client for the purpose of making requests on behalf of other clients. Requests are serviced internally or by passing them on, with possible translation, to other servers. A proxy MUST implement both the client and server requirements of this specification. A "transparent proxy" is a proxy that does not modify the request or response beyond what is required for proxy authentication and identification. A "non-transparent proxy" is a proxy that modifies the request or response in order to provide some added service to the user agent, such as group annotation services, media type transformation, protocol reduction, or anonymity filtering. Except where either transparent or non-transparent behavior is explicitly stated, the HTTP proxy requirements apply to both types of proxies.
bulletGateway: A server which acts as an intermediary for some other server. Unlike a proxy, a gateway receives requests as if it were the origin server for the requested resource; the requesting client may not be aware that it is communicating with a gateway.
bulletCache: A program's local store of response messages and the subsystem that controls its message storage, retrieval, and deletion. A cache stores cacheable responses in order to reduce the response time and network bandwidth consumption on future, equivalent requests. Any client or server may include a cache, though a cache cannot be used by a server that is acting as a tunnel.

For more...

bullet

General reference at W3C: http://www.w3.org/Protocols/

bullet

HTTP Reference (RFC 2616): http://ftp.isi.edu/in-notes/rfc2616.txt  

Operation of HTTP

Connection

bulletThe client makes a TCP-IP connection to the host using the domain name or IP number , and the port number given in the address.
bulletIf the port number is not specified, 80 is always assumed for HTTP.
bulletThe server accepts the connection.
bulletNote: HTTP currently runs over TCP, but could run over any connection-oriented service. 

Request

bulletThe client sends a document request consisting of a line of ASCII characters terminated by a CR LF (carriage return, line feed) pair. A well-behaved server will not require the carriage return character.
bulletThis request consists of the word "GET", a space, the document address , omitting the "http:, host and port parts when they are the coordinates just used to make the connection. (If a gateway is being used, then a full document address may be given specifying a different naming scheme).
bulletThe document address will consist of a single word (ie no spaces). If any further words are found on the request line, they MUST either be ignored, or else treated according to the full HTTP spec .
bulletThe search functionality of the protocol lies in the ability of the addressing syntax to describe a search on a named index .
bulletA search should only be requested by a client when the index document itself has been described as an index using the ISINDEX tag .

Response

bulletThe response to a simple GET request is a message in hypertext mark-up language ( HTML ). This is a byte stream of ASCII characters.
bulletLines shall be delimited by an optional carriage return followed by a mandatory line feed character. The client should not assume that the carriage return will be present. Lines may be of any length. Well-behaved servers should restrict line length to 80 characters excluding the CR LF pair.
bulletThe format of the message is HTML - that is, a trimmed SGML document. Note that this format allows for menus and hit lists to be returned as hypertext. It also allows for plain ASCII text to be returned following the PLAINTEXT tag .
bulletThe message is terminated by the closing of the connection by the server.
bulletWell-behaved clients will read the entire document as fast as possible. The client shall not wait for user action (output paging for example) before reading the whole of the document. The server may impose a timeout of the order of 15 seconds on inactivity.
bulletError responses are supplied in human readable text in HTML syntax. There is no way to distinguish an error response from a satisfactory response except for the content of the text.

Disconnection

bulletThe TCP-IP connection is broken by the server when the whole document has been transferred.
bulletThe client may abort the transfer by breaking the connection before this, in which case the server shall not record any error condition.
bulletRequests are independent . The server need not store any information about the request after disconnection.

 

Client Methods

Client methods are the information sent to a web server by the client (web browser) that determines what actions are desired.  The general types of methods include:

bulletGet: requests a specific document from the server; may include output from a script; may include a querystring with data.
bulletHead: server will respond with header information only, no entity-body.
bulletPost: send data to the server in the entity-body of the client request; file uploads can also be accomplished under the post method.
bulletPut: store data to the server.
bulletDelete: remove data from the server.
bulletTrace: follow the path of a request through various proxy servers.
bulletOptions: server returns options available for a server.
bulletConnect: enables a connection to another server, typically a secure server.

Server Response Codes

The following codes are returned from the server.  Also included are some of the typical responses:

bullet100-199 -- informational
bullet200-299 -- client request successful
bullet200 -- OK
bullet201 -- Created (new URL)
bullet202 -- request accepted, but not immediately acted upon
bullet300-399 -- client request redirected, further action necessary
bullet300 -- multiple choices
bullet301 -- moved permanently
bullet302 -- found
bullet305 -- proxy used
bullet400-499 -- client request incomplete
bullet400 -- bad request
bullet401 -- unauthorized
bullet402 -- payment required
bullet403 -- forbidden
bullet404 -- not found
bullet405 -- method not found
bullet500-599 -- server errors
bullet500 -- internal server error
bullet501 -- not implemented
bullet502 -- bad gateway

 

 

Home ] Up ] Computer Architecture ] Programming Bootcamp ] Database Bootcamp ] Visual BasicS ] Web Basics ] Web Multimedia ] Web Programming ] Developing Web Sites ] XML Technology ] Web Glossary ]

Copyright © 1999 - 2005 
ThePlace - Written and Sponsored by Dave Hillman