Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

How does esp32 http get and http post work?


Asked by Jolene Vazquez on Dec 05, 2021 HTTP



The httpGETRequest () function makes a request to Node-RED address http://192.168.1.106:1880/get-sensor and it retrieves a string with a JSON object. To get access to the values, decode the JSON object and store all values in the sensorReadingsArr array.
Besides,
Firstly, the client (ESP32) will submit an HTTP request to the server (ThingSpeak/IFTTT). Secondly, the server will return a response to the client. Lastly, the response will be received which will contain the status information and the requested content of the request.
Subsequently, Every time you make a request to the ESP32 or ESP8266 to access the web server, it will check whether you’ve already entered the correct username and password to authenticate. Basically, to add authentication to your web server, you just need to add the following lines after each request:
In fact,
Here’s an example: The ESP32 (client) submits an HTTP request to a Raspberry Pi running Node-RED (server); The server returns a response to the ESP32 (client); Finally, the response contains status information about the request and may also contain the requested content.
Thereof,
Firstly, the client (ESP32) will submit an HTTP request to the server (ThingSpeak/OpenWeatherMap.org). Secondly, the server will return a response to the client. Lastly, the response will be received which will contain the status information and the requested content of the request. We will program our ESP32 board in Arduino IDE.