Cố gắng gửi yêu cầu POST JSON tới API HTTP (PushBullet). Nhưng phải đối mặt với lỗi trong mã. Bất kỳ trợ giúp nào được đánh giá cao. Reference to the document to send push notificationCách đăng dữ liệu JSON qua API HTTP bằng VBScript?
Dim objXmlHttpMain , URL
strJSONToSend = {"type": "note", "title": "Alert", "body": "Lorem Ipsum Lorem Ipsum Lorem Ipsum."}
URL="https://api.pushbullet.com/v2/pushes"
Set objXmlHttpMain = CreateObject("Msxml2.ServerXMLHTTP")
on error resume next
objXmlHttpMain.open "POST",URL, False
objXmlHttpMain.setRequestHeader "Authorization", "Bearer <api secret id>"
objXmlHttpMain.setRequestHeader "Content-Type", "application/json"
objXmlHttpMain.send strJSONToSend
set objJSONDoc = nothing
set objResult = nothing
Cảm ơn rất nhiều! Iam xin lỗi iam rất mới với vbscript! –