Complete the code to include the library needed for HTTP requests.
#include <[1]> void setup() { Serial.begin(9600); }
The HTTPClient.h library is needed to make HTTP requests from Arduino.
Complete the code to start an HTTP GET request to the URL.
HTTPClient http; http.begin("[1]"); int httpCode = http.GET();
The http.begin() function needs the URL string to start the HTTP request.
Fix the error in reading the HTTP response payload.
if (httpCode > 0) { String payload = http.[1](); Serial.println(payload); }
The correct function to get the response body as a string is getString().
Fill both blanks to properly close the HTTP connection and free resources.
http.[1](); http.[2]();
The end() function closes the connection and frees resources. It should be called once after the request.
Fill all three blanks to create a dictionary of HTTP headers and print a specific header value.
http.begin("http://example.com"); http.addHeader([1], [2]); String headerValue = http.header([3]); Serial.println(headerValue);
You add a header with key "Content-Type" and value "application/json". Then you get the header value by key "Content-Type".