Whats wrong with my POST request? Ive been trying to get POST working on my ESP8266. I followed this tutorial https://techtutorialsx.com/2016/07/21/esp8266-post-requests/ which works, but once i change the request URL to anything else i get -1 response from http.POST() which the library returns when &quot;no info&quot;.
I have no clue what the &quot;no info&quot; means and what im doing wrong. Does anyone have any suggestions? Below is the code im using.
if (WiFi.status() == WL_CONNECTED) { //Check WiFi connection status
 
    HTTPClient http;    //Declare object of class HTTPClient
 
    //http.begin(&quot;http://192.168.1.88:8085/hello&quot;); //Works fine
    //http.begin(&quot;https://httpbin.org:8080/post&quot;); //Causes -1 as httpCode
    //http.begin(&quot;https://httpbin.org/post&quot;); //Causes -1 as httpCode
    http.begin(&quot;https://XXXXX.execute-api.eu-west-2.amazonaws.com/XXXXX/XXXXX&quot;);
    http.addHeader(&quot;Content-Type&quot;, &quot;application/json&quot;);  //Specify content-type header
 
    int httpCode = http.POST(&quot;{\&quot;key\&quot;:\&quot;1\&quot;,\&quot;id\&quot;: \&quot;ESPXXX2\&quot;,\&quot;action\&quot;: \&quot;rbg\&quot;,\&quot;value\&quot;: \&quot;255255000\&quot;}&quot;);   //Send the request
    String payload = http.getString(); //Get the response payload
 
    Serial.println(httpCode);   //Print HTTP return code
    Serial.println(payload);    //Print request response payload
 
    http.end();  //Close connection
 
  } else {
 
    Serial.println(&quot;Error in WiFi connection&quot;);
 
  }
 
  delay(10000);  //Send a request every 10 seconds

Only serial output im getting is &quot;-1&quot; for httpCode and empty line for payload.
I ended up ditching HTTPS since it doesnt seem to be implemented all that well (Requires hardcoding of fingerprint).
Changed the architecture of my system so that HTTPS is handled by Python which doesnt require jumping through hoops.