HTTP: All you need to know about the Hypertext Transfer Protocol

by Oct 4, 2020IoT Connectivity

At times, you might have wondered what those four letters ‘HTTP’ at the start of every address bar in the browser meant. Well, this post will try to answer some of those questions. But before we get into what HTTP is and everything about Hypertext transfer protocol. Let us briefly overview a few terms that we might repeatedly encounter while discussing HTTP.

Web Servers

These are special computers that store necessary software for the server to respond to the request from the client. It also stores component files of websites ( for example, HTML, images, CSS style sheets, etc.) The web server establishes a connection over the internet and physically transfers the data to the client’s device. To put it simply, any computer can work as a server, but it would not be as efficient as a dedicated system.


A schematic representation of how HTTP works

TCP and HTTP

Transmission control protocol is the underlying principle on which HTTP is based. The client and the server establish a connection. It is only after a successful establishment, it will allow the data to be transferred over the link.

HTTP schematic layer diagram

URL

It is the Universal Resource Locator that is unique to a website and acts like its address. The server looks for the files requested by the browser using the URL.

What HTTP actually is?

HTTP stands for Hyper Text Transfer protocol. It forms the medium of communication between the web server and the browser.HTTP is the language that browsers and servers use to communicate and ask for information that they require.

The working of HTTP is based on a request-response cycle. The server and browser establish a successful connection using the TCP which is underlying base for http. The cycle starts with the browser sending an HTTP request indicating what it is looking for. The server then looks for the required file having the same URL as that of the right. After fetching it, the server responds to the browser by sending it in the respective data completing a full cycle. If the server fails to find what the browser asked for, it responds with a standard HTTP message, which describes the error.

an http error message

Diving deeper into Hypertext Transfer Protocol

Now, that we have a basic understanding of the request response model let us get into the nuances of the requests made by the browser and the responses of thee web server respectively.

HTTP request

The request is the initiation of the cycle by the client which in most of the cases is a web browser. The request consists of the following parts

http request structure

Start line

This specifies the procedure, address of the resource, and in what format the web browser expects the data. It is further characterized into the following sections.

An http method

This describes what the web browser is asking for like whether it is asking for a resource, a resource with data response or it is submitting something causing a change at the server side. Put, Get, Head, Post are some http request method that ask server to perform different operations.

The request target

This is the address (URL) or the site where the request has to be performed. It describes the absolute path to be followed, port and domain.

GET http://iot4beginners.com an http method acting on a URL.

HTTP version

It specifies the format in which it expects the remaining message acting like an indicator of which http version to use for responding.

Headers

This passes on additional information about the requests and also about the client.

Headers in an http request

Body

It is the final part of the request. Not all requests have this element in them. The requests which intend to update server with data usually have body which carries the data. For example a “post” request which is used to send data to the server.

HTTP response

This is what server answers to the client’s request whether to fetch, put or any other such request. The response also has a specific structure to it. The following are the constituents of a standard http response.

http response structure

Status line

It is the beginning of part of thee response. It describes the http version along with a status code and status text which is nothing but a description of status code in human understandable form.

A standard http response status line: HTTP/1.1 302 The request page has been temporarily moved.

Headers

Like in the request part the headers here too provide additional information about the response of the server.

Body

Similar to request structure this is the last constituent of a response. It generally carries a file having content in them. They are not present when the status code is other than for a successful response. In this case the status code is sufficient for the user to know what is going on.

HTTP and HTTPS

HTTP doesn’t account for data security and issues that arise from it subsequently. So to make the web more secure a layer of encryption using SSL/TLS was added to Hypertext Transfer Protocol aka HTTP which was called Hypertext Transfer Protocol Secure aka HTTPS. Now under this protocol the messages are encrypted on both sides i.e. on the client as well as the server side.

HTTPS provides a three front advantages over HTTP namely Encryption, Authentication and Integrity. HTTPS authenticates websites and provides a third party verified certificate ensuring that connection to this website is secure and safe. It also looks after that the content is not distorted midway or is not tampered with by third party sources.

HTTP vs HTTPS

Footnotes on HTTP

HTTP is a stateless protocol at its core. It means that neither the browser nor the server remembers the earlier request or response. Every request and response is unique independent of previous requests or response. Though there have been changes in applications running besides a standard HTTP server, which has data stored as caches/cookies, etc.
It is a client-server protocol, which means the initiation has to be by the client. The server can’t initiate the request-response cycle.

HTTP and the Internet of Things

As discussed HTTP i.e. Hypertext Transfer Protocol is a definite set of rules which two devices use to communicate efficiently with each other. Now a genuine question arises which is can we use this protocol and integrate with an IoT project. To put in another words can I use HTTP protocol for communication between different devices in my project ? But before I answer this question let us look at some peculiar characteristics of HTTP.

HTTP is a one to one communication protocol.

What this means is we cannot have many clients sending requests at the same time to the server. It will not be feasible for the server to establish a separate connection each time as required by the TCP and then start the data transfer. Also it is a one way communication but in IoT applications we require a two way data transfer.

HTTP is based on request response model.

An external stimulus generally triggers an IoT system. But as we already know HTTP aka Hypertext Transfer protocol is request response based which given the resources of an IoT system is not feasible and will put tremendous load on the limited computing resources.

Power Consumption factor.

As discussed before the HTTP is quite heavy metaphorically and hence correspondingly the hardware support that would be needed would also consume a high amount of energy. Power consumption is an important factor in designing a system. Keeping this in mind HTTP will make a system more inefficient.

The above points it clearly seem to make a point that using HTTP (Hypertext transfer protocol) for an IoT application is surely not a good idea. Theoretically you can but the system will have serious issues when you will try to scale things up. But for systems like a web browser and a web server this protocol seems indispensable.

HTTP over the years

With advancements in technology the web is also constantly evolving. The amount of data shared, the multimedia on the web, all is in a constant state of flux. With this dynamic requirement the Hypertext Transfer Protocol also kept on evolving. With HTTP/1.1 then almost after 15 years Hypertext Transfer Protocol/2 was standardised in 2015. So next time when you see those four letters ‘HTTP’ you now know what do they mean.

To know about another one such protocol called MQTT which is rather a more popular protocol in IoT world click here.

Creating a multiplication Skill in Alexa using python

Written By Monisha Macharla

Hi, I'm Monisha. I am a tech blogger and a hobbyist. I am eager to learn and explore tech related stuff! also, I wanted to deliver you the same as much as the simpler way with more informative content. I generally appreciate learning by doing, rather than only learning. Thank you for reading my blog! Happy learning!

RELATED POSTS

What is Edge Intelligence: Architecture and Use Cases

What is Edge Intelligence: Architecture and Use Cases

Introduction With the latest advancements in AI technologies, we have noticed a significant increase in the deployment of AI-based applications and services in recent years. More recently, with the booming IoT industry in particular, billions of mobiles and IoT...

Apache Kafka vs Apache Spark : All you need to know

Apache Kafka vs Apache Spark : All you need to know

Introduction Due to the increase in the volume of data, the demand for Stream processing is on the rise. Just processing the data wouldn't be enough, it should be done quickly too so that organizations can react to changing market conditions on a real-time basis. This...

Creating a Multiplication Skill in Alexa using Python

Creating a Multiplication Skill in Alexa using Python

Introduction In this tutorial, we will be focusing on how to create a custom multiplication skill in Alexa using Python. If you're completely new to Alexa skills, you can get a brief idea about it by clicking here. Subsequently, we have posted regarding account...

Creating a Hello World Skill in Alexa using Python

Creating a Hello World Skill in Alexa using Python

Introduction In this tutorial, we will be focusing on how to create a Hello World Skill in Alexa Developer Console. This is the most basic skill, and it would give us an idea about Skill-building using Alexa's developer console. If you're completely new to Alexa, you...

Creating a custom Date-Time skill in Alexa using Python

Creating a custom Date-Time skill in Alexa using Python

Introduction In this tutorial, we will look at how to create a simple date-time skill in Alexa using Python. For this skill, the only prerequisites required are an Alexa developer account and some basic understanding of Python. Also, we have created a post on how to...

All you need to know about Amazon Alexa Skills

All you need to know about Amazon Alexa Skills

Introduction In this tutorial, we will be taking a quick look at Amazon Alexa Skills. So, let us get started with the most common question - What Is Amazon Alexa? Alexa is nothing but a cloud-based voice service provided by the tech giant Amazon. In today's world,...

Wi-Fi HaLow: IEEE 802.11ah Wireless Networking Protocol

Wi-Fi HaLow (pronounced "HEY-Low") is an IEEE 802.11ah wireless networking protocol. It was released in 2017 as an update to the IEEE 802.11-2007 wireless networking standard. It uses 900 MHz, license-exempt bands, to provide extended range Wi-Fi networks, as opposed...

What is IoT Cisco Virtualized Packet Core (VPC)?

What is IoT Cisco Virtualized Packet Core (VPC)?

In this article, we will discuss about what is Cisco Virtualized Packet Core (VPC), How it supports IOT. Finally, we discus about its use cases. What is Virtualized Packet Core (VPC)? Virtualized Packet Core (VPC) is a technology providing all services for 4G, 3G, 2G,...

10 Best FTP clients for Windows and MAC users

10 Best FTP clients for Windows and MAC users

FTP is the abbreviation for File Transfer Protocol. Its a commonly used protocol to exchange files over any network. FTP clients are specifically designed software to transfer files between PC and servers over the internet. When a file is being transferred from one...

What is DNS and How does it work?

What is DNS and How does it work?

The Internet is just a network of 'n' computers that can communicate over various communication channels. Now, anything you do on the Internet is only an exchange of information(through files, scripts, etc.) So for the exchange to happen, you need to locate the other...

VIDEOS – FOLLOW US ON YOUTUBE

EXPLORE OUR IOT PROJECTS

IoT Smart Gardening System – ESP8266, MQTT, Adafruit IO

Gardening is always a very calming pastime. However, our gardens' plants may not always receive the care they require due to our active lifestyles. What if we could remotely keep an eye on their health and provide them with the attention they require? In this article,...

How to Simulate IoT projects using Cisco Packet Tracer

In this tutorial, let's learn how to simulate the IoT project using the Cisco packet tracer. As an example, we shall build a simple Home Automation project to control and monitor devices. Introduction Firstly, let's quickly look at the overview of the software. Packet...

All you need to know about integrating NodeMCU with Ubidots over MQTT

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

All you need to know about integrating NodeMCU with Ubidots over Https

In this tutorial, let's discuss Integrating NodeMCU and Ubidots IoT platform. As an illustration, we shall interface the DHT11 sensor to monitor temperature and Humidity. Additionally, an led bulb is controlled using the dashboard. Besides, the implementation will be...

How to design a Wireless Blind Stick using nRF24L01 Module?

Introduction Let's learn to design a low-cost wireless blind stick using the nRF24L01 transceiver module. So the complete project is divided into the transmitter part and receiver part. Thus, the Transmitter part consists of an Arduino Nano microcontroller, ultrasonic...

Sending Temperature data to ThingSpeak Cloud and Visualize

In this article, we are going to learn “How to send temperature data to ThingSpeak Cloud?”. We can then visualize the temperature data uploaded to ThingSpeak Cloud anywhere in the world. But "What is ThingSpeak?” ThingSpeak is an open-source IoT platform that allows...

Amaze your friend with latest tricks of Raspberry Pi and Firebase

Introduction to our Raspberry Pi and Firebase trick Let me introduce you to the latest trick of Raspberry Pi and Firebase we'll be using to fool them. It begins with a small circuit to connect a temperature sensor and an Infrared sensor with Raspberry Pi. The circuit...

How to implement Machine Learning on IoT based Data?

Introduction The industrial scope for the convergence of the Internet of Things(IoT) and Machine learning(ML) is wide and informative. IoT renders an enormous amount of data from various sensors. On the other hand, ML opens up insight hidden in the acquired data....

Smart Display Board based on IoT and Google Firebase

Introduction In this tutorial, we are going to build a Smart Display Board based on IoT and Google Firebase by using NodeMCU8266 (or you can even use NodeMCU32) and LCD. Generally, in shops, hotels, offices, railway stations, notice/ display boards are used. They are...

Smart Gardening System – GO GREEN Project

Automation of farm activities can transform agricultural domain from being manual into a dynamic field to yield higher production with less human intervention. The project Green is developed to manage farms using modern information and communication technologies....