ServerXMLHTTP问题

xiaoduan0115 xiaoduan0115 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
各位好,用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" 设定情况下接收到值,谢谢各位了
...全文

相关推荐

评论 2
收藏 已收藏
分享
返回顶部
xiaoduan0115
ASP 28,401 成员 356,940 内容