I'm using ESP32 and the library HTTPClient to call an API, like that.
Code: Select all
HTTPClient http;
http.begin("http://130.101.93.116/resource/comanda");
http.addHeader("Content-Type", "application/x-www-form-urlencoded"); //Specify content-type header
int httpResponseCode = http.GET();
if(httpResponseCode>0){
String response = http.getString(); //Get the response to the request
Serial.print("httpResponseCode: "); //Print return code
Serial.println(httpResponseCode);
Serial.println(response); //Print request answer
}else{
Serial.print("Error on sending GET: ");
Serial.println(http.errorToString(httpResponseCode));
}
http.end();
Code: Select all
httpResponseCode: 200
<html>
<head>
<meta http-equiv='refresh' content='1; url=http://130.101.93.116/resource/comanda&arubalp=298629fd-4805-4e2c-bd14-9b616ceb85'>
</head>
</html>