ServerXMLHTTP问题
各位好,用ServerXMLHTTP 发送参数接收的问题
setRequestHeader "Content-type", "text/xml" 这样设置接收页面接到的是空值
setRequestHeader "Content-type", "application/x-www-form-urlencoded" 这样设置接收页面可以正常接收值
发送参考代码
send_mid_str="key=123&id=123456"
Set http=Server.CreateObject("MSXML2.ServerXMLHTTP")
http.Open "POST","http://localhost/a.asp",false
http.setTimeouts 5000,5000,5000,10000
http.setRequestHeader "Content-type", "text/xml"
'字串转义
request_string = URLEncoding(send_mid_str)
Http.send(request_string)
if Http.readystate<>4 then
response.write "提交到目标服务器出错!"
else
retu_str=bytesToBSTR(http.responseBody,"UTF-8")
end if
set http=nothing
Response.write retu_str
接收参考代码 a.asp
key=Request("key")
id=Request("id")
Response.write "key="&key&"id="&id
发送代码的程序不能修改,现在就是接收页面需要如何修改才能在setRequestHeader "Content-type", "text/xml" 设定情况下接收到值,谢谢各位了
setRequestHeader "Content-type", "text/xml" 这样设置接收页面接到的是空值
setRequestHeader "Content-type", "application/x-www-form-urlencoded" 这样设置接收页面可以正常接收值
发送参考代码
send_mid_str="key=123&id=123456"
Set http=Server.CreateObject("MSXML2.ServerXMLHTTP")
http.Open "POST","http://localhost/a.asp",false
http.setTimeouts 5000,5000,5000,10000
http.setRequestHeader "Content-type", "text/xml"
'字串转义
request_string = URLEncoding(send_mid_str)
Http.send(request_string)
if Http.readystate<>4 then
response.write "提交到目标服务器出错!"
else
retu_str=bytesToBSTR(http.responseBody,"UTF-8")
end if
set http=nothing
Response.write retu_str
接收参考代码 a.asp
key=Request("key")
id=Request("id")
Response.write "key="&key&"id="&id
发送代码的程序不能修改,现在就是接收页面需要如何修改才能在setRequestHeader "Content-type", "text/xml" 设定情况下接收到值,谢谢各位了
...全文
相关推荐
模拟多线程下载+断点续传
vfp 调用 ServerXmlHttp 组件,模拟多线程下载断点续传
msxml3.dll 错误 80070005 拒绝访问
msxml3.dll 错误 80070005拒绝访问。 解决办法: 赋予程序所在文件夹 internet 来宾帐号(IUSR_WEB)可写。
asp中使用MSXML2.DOMDocument处理XML数据时的注意事项
主要介绍了asp中使用MSXML2.DOMDocument处理XML数据时的注意事项,本文给出了4个需要注意的问题,需要的朋友可以参考下
VBA爬取网页数据方法[源码]
本文详细介绍了四种使用VBA爬取网页数据的方法,包括使用InternetExplorer.Application、WinHttp.WinHttpRequest.5.1、msxml2.xmlhttp和Msxml2.ServerXMLHTTP对象。每种方法都有其优缺点,例如方法1会后台打开浏览器,方法2和方法4在WPS中可能触发安全错误,方法3存在缓存问题。文章还提供了解决乱码和缓存问题的方案,如使用正则表达式替代DOM操作以及清除浏览器缓存。此外,还介绍了如何通过Adodb.Stream对象处理编码问题。最后,文章推荐了进一步学习的资源链接。
用VBS实现的发送带Cookie的HTTP请求的代码
在昨天的《使用正确版本的XMLHTTP》中卖了个关子,ServerXMLHTTP的功能比XMLHTTP强大,你现在大概已经猜到了吧。没错,用ServerXMLHTTP可以在HTTP请求头中加入Cookie,而XMLHTTP不可以


