从另一个网站调用经典 asp 中的 ServerXMLHTTP post 接收 xml
我正在编写 ASP 网页到 ASP 网页对话的双方,其中原始网页将信息推送到接收网页,然后接收网页对其进行处理并发回响应。 原始网页必须使用下面的代码来启动对话:
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
...然后接收页面中的 ASP 代码必须能够看到发送的信息。 我已经尝试了我能想到的一切。 该信息不在请求对象的 querystring
或表单数组中(因为内容类型是 text/xml
),并且我尝试将整个请求对象传递给 < code>domdocument 通过其 load()
和/或 loadxml()
方法。
无论我做什么,我都找不到该信息,但我知道它正在发送,因为当我将内容类型更改为 application/x-www-form-urlencoded
时,我可以看到它位于 request.form 数组中。
那么,当内容类型为 text/xml
时,我的信息在哪里?
I am writing both sides of an ASP-webpage to ASP-webpage conversation in which the originating webpage pushes information to the receiving webpage which then processes it and sends back a response. The originating webpage must use the code below to start the converstation:
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
...and then somehow the ASP code in the receiving page has to be able to see the information that was sent. I have tried everything I can think of. The information is not in the request object's querystring
or form arrays (because the content-type is text/xml
) and I've tried passing the entire request object to a domdocument
via its load()
and/or loadxml()
methods.
No matter what I do, I can't find the information but I know that it is being sent because when I change the content-type to application/x-www-form-urlencoded
, I can see it in request.form
array.
So where is my information when the content-type is text/xml
?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
当您将内容类型设置为“text/xml”时,您确实需要将信息作为 XML 字符串而不是名称值列表发送。
然后,在接收 ASP 页面中,您将捕获 XML,如下所示:
When you set the content-type to "text/xml" you really need to send the information as an XML string, not a name-value list.
Then, in your receiving ASP page, you would then capture the XML as follows: