| HTTP is one of the most successful and widely | | | | returned. |
| used protocols on the Internet today. It is | | | | Response |
| application-layer protocol used to transmit and | | | | It is the response send by the web server to |
| receive hypertext pages. HTTP allows a client | | | | client. The server firstly locates the requested |
| usually a web browser to send a simple request | | | | document and sends the appropriate response. |
| and receive response back from the server. | | | | However there is a format specified by HTTP to |
| Whenever you write a URL in address bar of you | | | | send the response from server. Every HTTP |
| browser, your browser firstly contacts the web | | | | response consists of Status-Line, |
| server, web server locates the requested page | | | | Response-Headers and Message-Body. Sample |
| and sends the appropriate response. These | | | | HTTP response is shown below. |
| requests and responses are issued in HTTP. | | | | HTTP/1.1 200 OK |
| Each HTTP cycle has following steps: | | | | Server: Apache/1.3.3.7 |
| Connection | | | | Date: Mon, 23 May 2005 22:38:34 GMT |
| The connection is established between a web | | | | Accept-Ranges: bytes |
| browser and a web server. The connection is | | | | Content-Type: text/html |
| established via TCP/IP protocols over particular | | | | Content-Length: 512 |
| port generally port 80 is used. However, HTTP is | | | | Last-Modified: Tue, 18 Jan 2007 10:12:30 GMT |
| not used to establish connection, it only defines | | | | Connection: closehello worldHello world |
| the rules that specify how they communicate. | | | | The first line of the every HTTP response is |
| Request | | | | called the Status-Line and consists of numeric |
| The web browser sends a request to server, | | | | status code returned along with reason phrase. It |
| specifying the resource to retrieve. HTTP defines | | | | is the response returned associated with the |
| the set of rules for sending the request. Every | | | | HTTP request. After Status-Line, |
| HTTP request consists of Request-Line, | | | | Response-Header starts and providing the |
| Request-Headers and Message-Body. Sample | | | | characteristics associated with data returned. |
| HTTP request is shown below. | | | | Close |
| GET /index.htm HTTP/1.1 | | | | Finally connection is closed. After each request |
| HOST: | | | | and response cycle the connection is closed. Each |
| Accept: text/html, text/plain | | | | time the web browser makes request, new |
| User-Agent: Mozilla/4.0 | | | | connection is established. There is no account for |
| Each HTTP request has request line and consists | | | | the previous requested resource on web server |
| of request methods, URI, and HTTP version. | | | | or I can say that there is no session maintained. |
| After Request-Line, Request-Header starts and | | | | This makes HTTP a stateless protocol. |
| providing the characteristics associated with data | | | | |