Introduction to HTTP ( Hyper Text Transfer Protocol )

HTTP or Hypertext Transfer Protocol is a standard protocol for transferring web pages and their content across the Internet. It is the set of rules for transferring files, text, graphic images, sound, video, and other multimedia files on the World Wide Web. As soon as a Web user opens their Web browser, the user is indirectly making use of HTTP. HTTP is an application protocol that runs on top of the TCP/IP suite of protocols.

When a client makes a request of a website server, HTTP takes that request and establishes a connection between client and server via TCP. Then HTTP sends the request over to the server, which pulls up the requested information and hands it back, and HTTP carries the response back to the client.

HTTP is a generic and stateless protocol which can be used for other purposes as well using extensions of its request methods, error codes, and headers. The default port is TCP 80, but other ports can be used as well. It provides a standardized way for computers to communicate with each other. HTTP specification specifies how clients' request data will be constructed and sent to the server, and how the servers respond to these requests.

Characteristics of HTTP protocol is as follows :

  • HTTP is a stateless protocol, based on a series of client requests and web server responses.
  • It is the protocol that allows web servers and browsers to exchange data over the web.
  • HTTP requests and responses are comprised of Headers, followed by request or response body.
  • HTTP requests must use a specific request method.
  • It uses the reliable TCP connections by default on TCP port 80.
  • HTTP response contain a status code.
  • HTTP is a plaintext protocol.

Features of HTTP Protocol : 

There are there basic features of HTTP Protocol, which are as follows :

HTTP is media independent : It refers to any type of media content can be sent by HTTP as long as both the server and the client can handle the data content.

HTTP is stateless : The client and server are aware of each other during a current request only. Afterwards, both of them forget each other. Due to the stateless nature of protocol, neither the client nor the server can retain the information about different request across the web pages.

HTTP is connection-less : The HTTP client, i.e., a browser initiates an HTTP request and after a request is made, the client disconnects from the server and waits for a response. The server processes the request and re-establishes the connection with the client to send a response back.


The basic Architecture of HTTP Protocol :

The below diagram shows the basic architecture of web application and depicts where HTTP stands :


HTTP is request/response protocol which is based on client/server based architecture. In this web browser, search engines, etc behaves as a HTTP clients, and the Web server behaves as a server.

Client :  The HTTP client sends a request to the server in the form of a request method, URI, and protocol version, followed by a MIME-like message containing request modifiers, client information, and possible body content over a TCP/IP connection.

Server : The HTTP server responds with a status line, including the message's protocol version and a success or error code, followed by a MIME-like message containing server information, entity meta information, and possible entity-body content.


HTTP Request Methods :

The request sends by the computer to a web server that contains all sorts of potentially interesting information is known as HTTP requests. The set of common HTTP request methods for HTTP 1.1 is given below :

1. GET : The GET method is used to retrieve information from the given server using a given URI. Requests using GET should only retrieve data and should have no other effect on the data.

2. HEAD : The HEAD method asks for a response identical to that of a GET request, but without the response body.

3. POST : The POST method is used to submit an entity to the specified resource, often causing a change in state or side effects on the server.

4. PUT : The PUT method replaces all current representations of the target resource with the request payload.

5. DELETE : The DELETE method deletes the specified resource.

6. CONNECT : The CONNECT method establishes a tunnel to the server identified by the target resource.

7. OPTIONS : The OPTIONS method is used to describe the communication options for the target resource.

8. TRACE : The TRACE method performs a message loop-back test along the path to the target resource.





Next Topic :

No comments:

Post a Comment