HTTP
HTTP, the Hypertext Transfer Protocol, is the standard protocol for communication between web browsers and web servers. HTTP specifies how a client and server establish a connection, how the client requests data from the server, how the server responds to that request, and finally how the connection is closed. HTTP connections use the TCP/IP protocol for data transfer.
HTTP 1.0 is the currently accepted version of the protocol. It uses MIME to encode data. The basic protocol defines a sequence of four steps for each request from a client to the server:
Making the connection. The client establishes a TCP connection to the server, on port 80 by default; other ports may be specified in the URL.
Making a request. The client sends a message to the server requesting the page at a specified URL. The format of this request is typically something like:
GET /index.html HTTP 1.0
GETis a keyword./index.htmlis a relative URL to a file on the server. The file is assumed to be on the machine that receives the request, so there is no need to prefix it withhttp://www.thismachine.com/.HTTP 1.0is the version of the protocol that the client understands. The request is terminated with two carriage return/linefeed pairs (\r\n\r\nin Java parlance) regardless of how lines are terminated on the client or server platform.Although the
GETline is all that is required, a client request can include other information as well. This takes the following form:Keyword: Value
The most common such keyword ...