im currently working on a project with an ESP32 where I need to execute two HTTP requests sequentially:
first, I fetch data from a specific URL, and then I ping the same URL with additional parameters to confirm that esp procesed it.
Here's what my code looks like:
HTTPClient http;
// Fetch data from the server
if (http.begin("http://example.com/1.php") && http.GET() == 200) {
String data = http.getString();
http.end();
HTTPClient http;
http.begin("http://example.com/1.php?confirmed=1");
http.end();
}
but on second time i get http status -1 ( i checked server and it has no problem)
so im wonder if i need to type HTTPClient http; 2 times and do i need to use http.end() just once at end