1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
<%

PushServerURL = "https://android.googleapis.com/gcm/send"


ApplicationAPIKey = "AIzaS"


RegId = "APA91bEqDLVNxmhjPyNtXmtdXnFsGjiWX_IankBMMg"


tickerText = "黑"

contentTitle = "哈"

message = "120"

postJSONData = "" & _
"{" & _
" ""registration_ids"" : [ """ & RegId & """ ]" & _
", ""data"": {" & _
" ""tickerText"" : """ & tickerText & """" & _
" , ""contentTitle"" : """ & contentTitle & """" & _
" , ""message"" : """ & message & """" & _
" }" & _
"}"

Set httpObj = Server.CreateObject("WinHttp.WinHttpRequest.5.1")
httpObj.open "POST" , PushServerURL, False
httpObj.SetRequestHeader "Content-Type", "application/json"
httpObj.SetRequestHeader "Authorization", "key=" & ApplicationAPIKey
httpObj.Send postJSONData
httpObj.WaitForResponse

If httpObj.Status = "200" Then
response.Write("GG : " & httpObj.ResponseText)
Else
response.Write("DD : " & httpObj.ResponseText)
End If

%>






參考:http://2nusa.blogspot.tw/2014/01/classic-asp.html
arrow
arrow
    全站熱搜

    戮克 發表在 痞客邦 留言(0) 人氣()