How to make HTTP requests

In this tutorial, we will learn how to make HTTP requests from your microcontroller of choice. 

The microcontrollers currently supported by this article are:

  • SSTuino II
  • Arduino Uno WiFi Rev 2
  • Arduino MKR WiFi 1010
  • Arduino Nano 33 IoT
  • Any Arduino-based microcontroller using the WiFiNINA API

Table of Contents

What is HTTP?

HTTP is the basis of most connections you make on the Internet when you load up websites. It is a data protocol (just like MQTT), which is a language that computers use to talk to each other. When your device sends out a request, the server will reply back with a response, just like how you type in an address in your browser and the web server returns back with the contents of the website.

Types of HTTP Requests

<Talk about the various types of requests here>

Before we get started with the type of requests, you will first need to check if the request is going to an HTTP or HTTPS address. The majority of modern websites use HTTPS, to ensure that the data travelling between your device and the server is safely encrypted and nobody else could read it. Some older websites still use HTTP. 

The address should have either http:// or https:// prefixed in front of it. If you are connecting via HTTPS, you should use WiFiSSLClient. If not, WiFiClient is all you need.

Receiving Data: Initiating a simple GET request

<Tutorial here on how to make a GET request>

Sending Data: Initiating a simple POST request

<Tutorial here on how to make a POST request>

Advanced topic: Parsing JSON from the response

<Introducing ArduinoJSON and how to use it>