HTTP -protocol analysis

Β·

3 min read

hmmm so πŸ€”πŸ€”πŸ€”πŸ€”What is HTTP protocol?

The Hypertext Transfer Protocol (HTTP) is the foundation of the World Wide Web, and is used to load web pages using hypertext links.

Screenshot_20210522-122155~2.png HTTP is an application layer protocol that allows web-based applications to communicate and exchange data. HTTP is request/response protocol which is based on client/server based architecture. In this protocol, web browser, search engines, etc. behave as HTTP clients and the Web server like Servlet behaves as a server. Screenshot_20210522-122337~2.png

few important things about http:🧐🧐🧐🧐

  • The HTTP is messenger of web.
  • It is a TCP/IP based protocol.
  • It is used to deliver contents for example:images, videos, audios, documents,etc.
  • It is a request response protocol.

The Basic Features of HTTPπŸ€“πŸ€“πŸ€“

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

2.HTTP is connectionless: It is a connectionless approach in which HTTP client i.e., a browser initiates the HTTP request and after the request is sent the client disconnects from server and waits for the response.

3.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 message basic construction:

Screenshot_20210522-123349~2.png

1.A start-line describing the requests to be implemented, or its status of whether successful or a failure. This start-line is always a single line.

2.An optional set of HTTP headers specifying the request, or describing the body included in the message. A blank line indicating all meta-information for the request has been sent.

3 An optional body containing data associated with the request (like content of an HTML form), or the document associated with a response. The presence of the body and its size is specified by the start-line and HTTP headers.

Request HTTP message

Start-line: - HTTP Method, URI and HTTP Version Header: - it contains the name and value pairs (key and value pairs) Body: - some content about the requested source. (In general, the body does not exist)

Method: - The methods are well-defined HTTP methods (GET/POST/PUT/DELETE/OPTION, etc.) that tells the server what to do for the current HTTP request. URI: - Uniform Resource Identifier, which is a set of readable strings of characters, is the way to locate the targeted resource. HTTP Version: - The version of HTTP which is being used by the client. Screenshot_20210522-121953~2.png

Response HTTP message

Start-line: - HTTP Version and status code (URI and HTTP methods are specifically for Request message) Header: - it contains the name and value pairs (key and value pairs) Body: - the requested source by client

I hope this content will help you to get a brief idea about how HTTP works and how the web works.😁

Thank you very much😁