Chances are you're familiar with HTTP, but even if you’re not, you’ve seen the letters at the beginning of every website. Like this one - http://www.adafruit.com

HTTP stands for Hyper Text Transfer Protocol (hey will  you look at that, it's even called a protocol!) It’s used by devices connected internet to send website data back and forth. Note that you may connect to the internet using Ethernet at work, WiFi at home, or Cellular on the go - but the HTTP part is the same for every website.

Note that while many people assume that the internet is all HTTP, it isn't! It's just the most popular procotol. There are other protocols you may bump into in your travels, such as the once-popular FTP (File Transfer Protocol) which is used to transfer files around, and SMTP (Simple Mail Transfer Protocol) which is how your e-mail gets delivered.

Stateless-ness

HTTP is stateless, so you have to have a connection per data transfer - one connection every time you want to write data, one connection for reading. (You can use persistent to keep the connection open but many simplified microcontroller stacks assume one connection per request, and its considered bad taste to keep it open indefinitely - eventually the server will kick you out!)  HTTP is optimized for huge amounts of data such as used for websites, and it can be used for IoT connections. But it's not lightweight: there's a lot of headers and encoding per request. And it’s not that fast when it comes to .

Internet of TOAST

Another problem with HTTP is that it's pull only. Let’s say you have an IoT device- Internet of Toaster - this toaster is connected to the Internet and can send you toast updates, as well as have its settings managed securely online.

With HTTP, your toaster can easy send data to the server whenever it wants (e.g. "Toast is done!") by connecting and submitting a REST PUT request. But if it wants to pull data from the server via REST GET, it has to constantly connect and ask ("Any updates to the Toast darkness level?" "What about now?" "Anything now?") which is really data and time consuming. Pull updates are either slow (check only every few minutes) or data/power intensive (check constantly).

To Summarize!

HTTP is:

  • asynchronous protocol, this means the client waits for the server to send the data.
  • a one way street, only the client makes the request.
  • one to one protocol, one client request at a time.
  • data heavy, filled with headers and rules.
This guide was first published on Dec 14, 2017. It was last updated on Dec 14, 2017.
This page (HTTP) was last updated on Jul 14, 2020.