What is HTTP Protocol?
HTTP stands for Hypertext Transfer Protocol. HTTP protocol designed to transfer information between computers over WWW (World Wide Web). The data transferred can be anything, a document, a file, an image, a video between computers over the Internet.
Hypertext Transfer Protocol is also the application layer protocol for the WWW.
An HTTP(Browser) sends a request to an HTTP server. And the server responds to the message.
The first version of the protocol had only one method, namely GET, which requested a page from a server. The response from the server was still an HTML page.
There have been several versions of HTTP starting from the original version 0.9, the latest version is 2.0, last revision in 2015.
HTTP protocol to exchange information in a specific way, nowadays one of the widely used protocols on the Internet.
How does It work?
The HTTP transfer protocol is made with a set of requests and responses. When you click a link that is hypertext, the client computer (your computer) sends a request to the computer (server) that serves that link for the information represented by the link. The server receives a request, also known as an HTTP request, and then processes it to retrieve the relevant information requested by the client computer. Once the data has been retrieved, the server responds (HTTP response) by transferring this data back. The customer then receives the information and displays it on your screen.
The HTTP protocol is also a stateless protocol because each command request is executed independently without any knowledge of the requests made before it. Or we can say that the current request does not know what has been done in previous requests.
The server does not need to store session information and that each request is independent of each other.
The Internet (or the Web) is a massively distributed client / server information system.
There are many applications running on the web simultaneously, such as web browsing / browsing, email, file transfer, audio and video streaming, etc.
For proper communication, applications must agree to a specific protocol at the application level such as HTTP, FTP, SMTP, POP, etc.
The browser converts the URL to a request message and sends it to the HTTP server.
The HTTP server interprets the request message and returns a suitable response message to you, which is either the resource you requested or an error message.
URL (Uniform Resource Locator)
Used to uniquely identify a resource on the web.
For example, the browser translated the URL http://www.iotgyaan.com/ in the following request message:
When this request message reaches the server, the server can perform one of these actions:
The server interprets the received request, maps the request to a file under the server’s documents directory, and returns the requested file to the client.
The server interprets the received request, maps the request to a program held in the server, executes the program, and returns the program’s output to the client.
The request cannot be fulfilled, the server returns an error message.
The browser receives the response message, interprets the message, and displays the content of the message in the browser window based on the media type of the response (as in the Content-Type response header).
A client can use any of these request methods to send a request message to an HTTP server.
GET Method: A client can use the GET request to get a web resource from the server. Or we can say that the GET method is used to get the data from the server. The GET method appends the parameters passed as a query string to a URL, in the form of key-value pairs. for example, if a parameter names = Williams, this string will be appended to the URL. By default, the method is GET.
HEAD method: A client can use the HEAD request to get the header that a GET request would have obtained. Since the header contains the last modified date of the data, this can be used to verify the local cache copy.
POST Method: Used to post data to the webserver. In the post method, the query string is appended alongside the query object, they are not appended in the URL, so the parameters are passed in hidden form.
PUT method: ask the server to store the data.
DELETE Method: ask the server to delete the data.
TRACE Method: Have the server return a diagnostic trace of the actions it takes.
OPTIONS Method: Ask the server to return the list of request methods it supports.
CONNECT Method: Used to tell a proxy to establish a connection with another host and simply respond to the content, without attempting to parse or cache it. This is often used to establish an SSL connection through the proxy.
Advantage of HTTP
Its independent platform, which allows direct cross porting. No runtime media required to function properly; it can be used on firewalls! For example, global applications. It is not connection-oriented, there is no need for network overload to create and maintain session state and information.
Also Read: Differences Between I2C and SPI Protocols
Drawbacks of HTTP
The integrity is not there so someone can easily edit the content. HTTP is not secure because there is no encryption method for it. So, he is subject to the man in the middle and listens to sensitive information. There is no authentication, so you will have no clear idea who you are initiating communication with. Authentication is sent in the clear to anyone who intercepts the request and can know the username and passwords used.
What is the alternative to HTTP protocol?
A new alternative to HTTP in the IOT space is the MQTT protocol. A common protocol for file transfer is FTP. Gopher is an ironic hipster alternative to surfing the web. And finally, WAP is an almost obsolete alternative to HTTP for constrained devices such as cell phones.
Also Read: Introduction of MQTT
What is the difference between HTTP and HTTPS?
HTTP is still the communications protocol in terms of the messages between browser and server. It doesn’t change in HTTPS. What HTTPS adds is transport level security on the network connection itself. It sits below the HTTP messages and is transparent to the ends of the connection. Outside of a different TCP, the HTTP requests are the same.
HTTPS was often referred to as SSL, meaning “Secure Sockets Layer”. Its purpose was encrypting the TCP socket connection between browser and server allowing for secure communications without an ability to intercept and decode it. This addition to the HTTP protocol was essential in the late 1990s in order to spur adoption of online shopping and banking. Without it we wouldn’t have these things today.
So, security was bolted on to the original HTTP protocol. Since browsers use protocol identifiers to figure out how to communicate, the “S” was added to HTTPS to denote “HTTP Secure”. The browser upon seeing this adds an extra step to it connect-to-server process and requests a secure session instead of a standard one on port 443 (default) first.
Short and long of it is HTTPS was created as an extension to HTTP to support secure communications.
Also Read: What Is Raspberry Pi And Sense HAT