Pages

Friday, August 14, 2020

What is HTTP?

 

HTTP is a protocol that helps to transfer information in the client-server architecture on the web. 

The message from the client(web browser) is called requests;
The message from the server is called the response.

Each request from the client is sent to the server which handles it at gives the result which is a response. In between client and server, there are few other entities which help in the transaction collectively known as proxies.

The machine or computer that relay the HTTP messages between the server and the client on the transport, network or physical layer without altering the message in any way but potentially making an impact on performance is called proxies.

Proxies may perform numerous functions:

  • caching (the cache can be public or private, as the browser cache)
  • filtering (like an antivirus scan or parental controls)
  • load balancing (to allow multiple servers to serve the different requests)
  • authentication (to control access to different resources)
  • logging (allowing the storage of historical information)

Features of HTTP:

  1. HTTP is simple
  2. HTTP is extensible
  3. HTTP is stateless, but not sessionless

The flow of HTTP message:

  1. Open TCP connection
  2. Send an HTTP message
  3. Read HTTP message from the server
  4. Close or release the connection for the next request

If HTTP pipelining is activated, several requests can be sent without waiting for the first response to be fully received.

HTTP message formats:

How do the request and response look like? It is a plain text? No, it is a readable text but in a specified format.

  1. HTTP request contains the HTTP method (GET/PUT) based on the need followed by the path of the resource (think this as a function name), the version of protocol and headers with optionally few parameters if required
  2. HTTP response contains HTTP protocol version, response status code, response status message and header details optionally the response data as per the resource defined.

Js

No comments:

Post a Comment