我正在尝试从我们支持的产品的 .asp 页面向 Twilio SMS Gateway 发送请求。
我正在使用以下代码编写请求并发送它:
Set oXMLHTTP = Server.CreateObject("Msxml2.serverXMLHTTP.6.0")
sMethod = "POST"
oXMLHTTP.Open sMethod, sUrl, false, smsAuthUser, smsAuthPass 'url, username and password are valid and included in configuration file
oXMLHTTP.setRequestHeader "Authorization", "Basic "& base64(smsAuthUser&"."&smsAuthPass)
oXMLHTTP.setRequestHeader "Content-Length", Len(sPostData)
oXMLHTTP.Send sPostData
请求正在发送,但不是发送消息,而是检索先前发送的消息列表(GET 请求行为)。
来自 Chrome Postman 的具有相同授权和发布数据的相同请求就像一个魅力,所以它似乎是 xmlhttp 对象问题。
什么会导致对象使用错误的方法发送请求,潜在的解决方法是什么?