What Is HTTP?

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

HTTP

What is HTTP?
HTTP, or Hypertext Transfer Protocol, is the foundation of data
communication on the World Wide Web. It is the standard protocol that
enables web browsers to request and receive content from web servers
across the internet.
World Wide Web Communication:
The World Wide Web is about communication between web clients and web
servers.

Clients are often browsers (Chrome, Edge, Safari), but they can be any type of
program or device.
Servers are most often computers in the cloud.

HTTP Versions:
1. HTTP/1.0: The original version of the HTTP protocol, released in 1996.
It provided the basic functionality for web browsing, but lacked features
like persistent connections and caching.
2. HTTP/1.1: Released in 1997, this updated version introduced many
improvements like persistent connections, better caching, and host
headers to support multiple websites on a single IP address.
3. HTTP/2: Launched in 2015, HTTP/2 brought major performance
enhancements through features like header compression, server push,
and multiplexing of requests over a single connection.
Advantages and Disadvantages of HTTP
Advantages:

➨It offers lower CPU and memory usage due to less simultaneous
connections.

➨It enables HTTP pipelining of requests/responses.

➨It offers reduced network congestion as there are fewer TCP connections.
➨Handshaking is done at the initial connection establishment stage. Hence it
offers reduced latency in subsequent requests as there is no handshaking.

➨It reports errors without closing the TCP connection.


Disadvantages:

➨It can be used for point to point connection.


➨It is not optimized for mobile.

➨It does not have push capabilities.


➨It is too verbose.

➨It does not offer reliable exchange (without retry logic).

HTTP Request Methods:


1. GET: Retrieves data from the server, such as a web page or an image.
2. POST: Sends data to the server, like form submissions or file uploads.
3. PUT: Updates an existing resource on the server, like a user's profile
information.
4. DELETE: Removes a resource from the server, such as deleting a user
account.
5. OPTIONS: Asks the server for information about the available
communication options.
6. HEAD: Retrieves the header information of a resource without the actual
content.

What is there in HTTP Request?


1. HTTP version type
2. a URL
3. an HTTP method(get,post)
4. HTTP request headers
5.
HTTP
body.
HTTP Response Contain:

● HTTP Status Line( http version + status


code)
● HTTP Headers
● HTTP Body
Main features of HTTP:

▶ Extensible: Headers make HTTP extensible as client and server may


agree to add any new field names and information to suit their needs.

▶ 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.
▶ 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.

▶ 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.

You might also like