0
8.5kviews
Discuss how Hypertext Transfer Protocol (HTTP) is used to access data on the World Wide Web.
1 Answer
1
212views

The Hypertext Transfer Protocol (HTTP) is a protocol used mainly to access data on the World Wide Web.

HTTP uses the services of TCP on well-known port 80.

The data transfer inHTTP is similar to SMTP because the data transferred between the client and the server look like SMTP messages.

enter image description here

Figure shows the HTTP transaction between the client and server.The client initializes the transaction by sending a request. The server replies by sending a response.

Request Message

A request message consists of a request line, a header, and sometimes a body.

Request Line: The first line in a request message is called a request line. There are three fields in this line separated by some character delimiter.The fields are called methods, URL, and Version. These three should be separated by a space character.

The second field, URL, defines the address and name of corresponding Web page. The third field, version, gives the version of the protocol; the most current version of HTTP is 1.1.

Header Lines: After the request line, we can have zero or more request header lines. Each header line sends additional information from the client to the server.

Body: The body can be present in a request message. Usually, it contains the comment to be sent.

Response Message

A response message consists of a status line, header lines, a blank line and sometimes a body.

Status Line: The first line in a response message is called the status line. There arethree fields in this line separated by spaces and terminated by a carriage return and linefeed. The first field defines the version of HTTP protocol, currently 1.1.

Header Lines: After the status line, we can have zero or more response header lines. Each header line sends additional information from the server to the client.

Body: The body contains the document to be sent from the server to the client. The body is present unless the response is an error message.

Please log in to add an answer.