时间: 2021-07-31 作者:daque
由于要做挪动梦网wap的少许接口,以是要用到这种办法,接下来会有asp.net本子的,这个是asp本子的,运用了msxml2.xmlhttp对像。 request.asp dim https set https=server.createobject("msxml2.xmlhttp") ’设置一个xmlhttp对像 https.open "post","http://127.0.0.1/testpost/response.asp",false https.send " echo 123456 987654 11111 22222 " if https.readystate=4 then response.write "提交胜利" ’readstate读取状况为4则胜利,连接反面的,不可功固然就不必连接处置了 dim objstream set objstream = server.createobject("adodb.stream") ’设置一个stream,由于读过来的径直拿出来是乱码的,以是得处置一下 objstream.type = 1 objstream.mode =3 objstream.open objstream.write https.responsebody objstream.position = 0 objstream.type = 2 objstream.charset = "gb2312" html = objstream.readtext ’转好码,就放到html里,好封闭那些对像 objstream.close set objstream = nothing set https=nothing end if response.write html response.asp ’创造domdocument东西 set xml = server.createobject ("msxml2.domdocument") xml.async = false ’承载post数据 xml.load request if xml.parseerror.errorcode <> 0 then response.write "不许精确接受数据" & "description: " & xml.parseerror.reason & "<br>line: " & xml.parseerror.line end if set blogchild=xml.getelementsbytagname("misc_command") ’the_text=blogchild.item(0).childnodes(1).text ’the_text=blogchild.item(0).text ’for i=0 to blogchild.length-1 response.write the_text 运用这种本领,asp里挪用servlet或web service都是很轻快的!