File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed
libraries/ESP8266HTTPClient/examples/PostHttpsClient Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -23,21 +23,21 @@ HTTPClient https;
2323
2424
2525void setup () {
26-
26+
2727 Serial.begin (115200 );
2828 Serial.println ();
2929 Serial.println ();
3030 Serial.println ();
3131
3232 WiFi.mode (WIFI_STA);
3333 WiFiMulti.addAP (WIFI_SSID, WIFI_PWD);
34-
34+
3535 Serial.println (" [WIFI] Connecting to WiFi ..." );
3636 while (WiFiMulti.run () != WL_CONNECTED) {
3737 Serial.print (' .' );
3838 delay (1000 );
3939 }
40-
40+
4141 Serial.println ();
4242 Serial.print (" [WIFI] Connected with IP : " );
4343 Serial.println (WiFi.localIP ());
@@ -49,10 +49,10 @@ void setup() {
4949
5050
5151void loop () {
52-
52+
5353 if ((WiFiMulti.run () == WL_CONNECTED)) {
5454 Serial.println (" [HTTPS] begin..." );
55-
55+
5656 std::unique_ptr<BearSSL::WiFiClientSecure>client (new BearSSL::WiFiClientSecure);
5757 client->setInsecure (); // Ignore SSL certificate
5858 // client->setFingerprint(fingerprint); //Use SSL
@@ -71,17 +71,16 @@ void loop() {
7171 Serial.println (" [HTTPS] POST... SUCCESS!" );
7272 Serial.println (payload);
7373 }
74-
75- // Error (response code is negative)
74+
75+ // Error (response code is negative)
7676 } else {
7777 Serial.printf (" [HTTPS] POST... failed, error: %s\n " , https.errorToString (httpCode).c_str ());
7878 }
7979 https.end ();
8080
81- // Unable to reach the server
81+ // Unable to reach the server
8282 } else {
8383 Serial.println (" [HTTPS] Unable to connect" );
8484 }
8585 }
86-
8786}
You can’t perform that action at this time.
0 commit comments