在我之前的问题中,我不小心发送了带有text/xml
Content-Type 的令牌/值对,导致没有发送任何内容。Tim C 对这个问题的洞察力非常有帮助。再次感谢蒂姆!
回顾最初的发送代码,我现在意识到将ServerXMLHTTP
Content-Type 设置text/xml
为是最近的错误添加。我在问题中发布的发送代码如下所示:
url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "UserName=Colt&PassWord=Taylor&Data=100"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "Content-Type", "text/xml"
xmlhttp.send information
实际的发送代码真的是:
url = "www.receivingwebsite.com\asp\receivingwebpage.asp"
information = "UserName=Colt&PassWord=Taylor&Data=100"
Set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP")
xmlhttp.Open "POST", url, false
xmlhttp.send information
...在发送之前不尝试设置 Content-Type。
不幸的是,最初导致我寻求帮助的问题仍然存在。我的接收经典 asp 页面看不到该ServerXMLHTTP
对象发布的信息。该信息不在请求对象的querystring
或form
数组中。无论我做什么,我都找不到信息,但我知道它正在发送,因为当我将 content-type 更改为 时,我可以在数组application/x-www-form-urlencoded
中看到它。request.form
那么MSXML2.ServerXMLHTTP
该类的默认内容类型是什么?
当发送类使用该默认内容类型时,我的信息在哪里?