Explanation of Hypertext Transfer Protocol (HTTP) – Application Layer Protocol

Download our Android App from Google Play Store and start reading Reference Notes Offline.

HTTPHypertext Transfer Protocol (HTTP),
Beneficial for Net Centric Computing Notes
and Web Technologies Notes| Sixth Semester,
BSc.CSIT | Tribhuvan University (TU)

HTTP (Hypertext Transfer Protocol)
HTTP stands for Hypertext Transfer Protocol. HTTP functions as a request-response protocol in the client-server computing model. It is a TCP/IP based communication protocol which is used to deliver virtually all files and other data, collectively called resources, on the World Wide Web. These resources could be HTML files, image files, query results, or anything else. A web browser works as an HTTP client because it sends requests to an HTTP server which is called Web server. The Web Server then sends responses back to the client. The response contains completion status information about the request and may also contain requested content in its message body. The format of the request and response messages is similar and will have following structure:

  • An initial line CRLF
  • Zero or more header lines CRLF
  • A blank line i.e. a CRLF
  • An optional message body like file, query data or query output.

CR and LF here mean ASCII values 13 and 10. The initial line is different for the request than for the response. A request line has three parts, separated by spaces: An HTTP Method Name, the local path of the requested resource, the version of HTTP being used. Example of initial line for Request Message is: “GET /path/to/file/index.html HTTP/1.0”. The initial response line, called the status line, also has three parts separated by spaces: The version of HTTP being used, a response status code that gives the result of the request, an English reason phrase describing the status code. Example, HTTP/1.0 200 OK or “HTTP/1.0 404 Not Found”

Header lines provide information about the request or response, or about the object sent in the message body. The header lines are in the usual text header format, which is: one line per header, of the form “Header-Name: value”, ending with CRLF. Example of Header Line is “User-agent: Mozilla/3.0Gold” or “Last-Modified: Fri, 31 Dec 1999 23:59:59 GMT”.

An HTTP message may have a body of data sent after the header lines. In a response, this is where the requested resource is returned to the client or perhaps explanatory text if there’s an error. In a request, this is where user-entered data or uploaded files are sent to the server.

The standard and default port for HTTP servers to listen on is 80 but it can be changed to any other port like 8081 etc.

HTTP is designed to permit intermediate network elements to improve or enable communications between clients and servers. HTTP is an application layer protocol designed within the framework of the Internet protocol suite.

HTTP has some of the important facts described as follows;

  • HTTP is connectionless: After a request is made, the client disconnects from the server and waits for a response. The server must re-establish the connection after it processes the request.
  • HTTP is media independent: Any type of data can be sent by HTTP as long as both the client and server know how to handle the data content. How content is handled is determined by the MIME specification.
  • HTTP is stateless: This is a direct result of HTTP’s being connectionless. The server and client are aware of each other only during a request. Afterwards, each forgets the other. For this reason neither the client nor the browser can retain information between different requests across the web pages. To maintain the state, we can use;
    1. Session Object in the server side
    2. Cookies in the client side.
    3. Hidden variables in the form
(Visited 85 times, 1 visits today)

Posted By : Digvijay | Comment RSS | Category : Sixth Semester
Tag : ,

Post a Comment

Your email is never published nor shared. Required fields are marked *


Wordpress DMCA
Community | Toolbar | Android App | Founder/Developer : Hari Prasad Chaudhary | CSIT Portal Manager : Digvijay Chaudhary