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;
23
23
24
24
25
25
void setup () {
26
-
26
+
27
27
Serial.begin (115200 );
28
28
Serial.println ();
29
29
Serial.println ();
30
30
Serial.println ();
31
31
32
32
WiFi.mode (WIFI_STA);
33
33
WiFiMulti.addAP (WIFI_SSID, WIFI_PWD);
34
-
34
+
35
35
Serial.println (" [WIFI] Connecting to WiFi ..." );
36
36
while (WiFiMulti.run () != WL_CONNECTED) {
37
37
Serial.print (' .' );
38
38
delay (1000 );
39
39
}
40
-
40
+
41
41
Serial.println ();
42
42
Serial.print (" [WIFI] Connected with IP : " );
43
43
Serial.println (WiFi.localIP ());
@@ -49,10 +49,10 @@ void setup() {
49
49
50
50
51
51
void loop () {
52
-
52
+
53
53
if ((WiFiMulti.run () == WL_CONNECTED)) {
54
54
Serial.println (" [HTTPS] begin..." );
55
-
55
+
56
56
std::unique_ptr<BearSSL::WiFiClientSecure>client (new BearSSL::WiFiClientSecure);
57
57
client->setInsecure (); // Ignore SSL certificate
58
58
// client->setFingerprint(fingerprint); //Use SSL
@@ -71,17 +71,16 @@ void loop() {
71
71
Serial.println (" [HTTPS] POST... SUCCESS!" );
72
72
Serial.println (payload);
73
73
}
74
-
75
- // Error (response code is negative)
74
+
75
+ // Error (response code is negative)
76
76
} else {
77
77
Serial.printf (" [HTTPS] POST... failed, error: %s\n " , https.errorToString (httpCode).c_str ());
78
78
}
79
79
https.end ();
80
80
81
- // Unable to reach the server
81
+ // Unable to reach the server
82
82
} else {
83
83
Serial.println (" [HTTPS] Unable to connect" );
84
84
}
85
85
}
86
-
87
86
}
You can’t perform that action at this time.
0 commit comments