【发布时间】:2015-01-13 09:28:33
【问题描述】:
尝试向 HTTP API(PushBullet)发送 JSON POST 请求。但面临代码错误。任何帮助表示赞赏。 Reference to the document to send push notification
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
【问题讨论】:
标签: json vbscript xmlhttprequest