https://www.cnss.com.cn潮汐数据返回JSON数据。
#include <WiFiClientSecure.h> //ESP32
//#include <ESP8266WiFi.h> //ESP8266
const char* ssid = "***"; // your network SSID
const char* password = "****"; // your network password
const char* server = "www.cnss.com.cn"; // Server URL
WiFiClientSecure client;
void setup() {
//Initialize serial and wait for port to open:
Serial.begin(115200);
delay(100);
Serial.print("Attempting to connect to SSID: ");
Serial.println(ssid);
WiFi.begin(ssid, password);
// attempt to connect to Wifi network:
while (WiFi.status() != WL_CONNECTED) {
Serial.print(".");
// wait 1 second for re-trying
delay(1000);
}
Serial.print("Connected to ");
Serial.println(ssid);
Serial.println("\nStarting connection to server...");
client.setInsecure();//skip verification
if (!client.connect(server, 443))
Serial.println(&