int postResult;
…
…
int httpCode = http.POST(jsonDataChar); //Send the data to save on server
String payload = http.getString(); //Get the response payload
String postSuccess = "200" ;
Serial.println(httpCode); //Print HTTP return code
postResult = payload.compareTo(postSuccess);
if (postResult == 0 ) {
digitalWrite(postLed, HIGH);
}
else{
digitalWrite(postLed, LOW);
}
In this code snippet where I am checking if a POST method was successful I am getting a "200" response from the server. But the postLed always remains OFF. ( The LED is fine otherwise )