เกี่ยวกับการส่งข้อความไปทางไลน์ โดยใช้บอร์ดNodeMCU แต่รันโค๊ดแล้วมันขึ้น Connection fail ตาม code ข้างล่างนี้
void Line_Notify(String message) {
WiFiClientSecure client;
if (!client.connect("notify-api.line.me", 443)) {
Serial.println("connection failed");
return;
}
String req = "";
req += "POST /api/notify HTTP/1.1\r\n";
req += "Host: notify-api.line.me\r\n";
req += "Authorization: Bearer " + String(LINE_TOKEN) + "\r\n";
req += "Cache-Control: no-cache\r\n";
req += "User-Agent: ESP8266\r\n";
req += "Connection: close\r\n";
req += "Content-Type: application/x-www-form-urlencoded\r\n";
req += "Content-Length: " + String(String("message=" + message).length()) + "\r\n";
req += "\r\n";
req += "message=" + message;
// Serial.println(req);
client.print(req);
delay(20);
ทั้งๆที่บอร์ดผมก็ต่อไวไฟได้แล้ว ต้องแก้ไขอะไรตรงไหนรึเปล่าครับ
ผู้รู้ช่วยแนะนำด้วยครับ