我正在尝试从 MS Access VBA 发送 POST URL 消息。当我尝试运行代码时,它告诉我无法编译以下语句。有谁知道我的语法在哪里不正确?预先感谢您的帮助。
objHTTP.Open "POST", "http://kt1.com/apiv2/Configuration.asmx", False
完整的代码是:
Private Sub newKT_WebService_Click()
Dim objHTTP As String
Dim replyTXT As String
Dim AuthCode As String
objHTTP = CreateObject("MSXML2.ServerXMLHTTP")
objHTTP.Open "POST", "http://kt1.com/apiv2/Configuration.asmx", False
objHTTP.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
objHTTP.send ("CallingID=12345&token=%20&domain=%20&userName=testuser&password=testpassword")
MsgBox objHTTP.responseText
End Sub