<%
response.write(getHTTPPage("http://sina.com.cn"))function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end functionFunction bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
%>
response.write(getHTTPPage("http://sina.com.cn"))function getHTTPPage(url)
on error resume next
dim http
set http=Server.createobject("Msxml2.XMLHTTP")
Http.open "GET",url,false
Http.send()
if Http.readystate<>4 then exit function
getHTTPPage=bytes2BSTR(Http.responseBody)
set http=nothing
if err.number<>0 then err.Clear
end functionFunction bytes2BSTR(vIn)
dim strReturn
dim i,ThisCharCode,NextCharCode
strReturn = ""
For i = 1 To LenB(vIn)
ThisCharCode = AscB(MidB(vIn,i,1))
If ThisCharCode < &H80 Then
strReturn = strReturn & Chr(ThisCharCode)
Else
NextCharCode = AscB(MidB(vIn,i+1,1))
strReturn = strReturn & Chr(CLng(ThisCharCode) * &H100 + CInt(NextCharCode))
i = i + 1
End If
Next
bytes2BSTR = strReturn
End Function
%>
xmlhttp.setRequestHeader('content-type','application/x-www-form-urlencoded');
xmlhttp.send('a=b');
//....
但是没用
然后示例代码:var myConn = new XHConn();if (!myConn) alert("XMLHTTP not available. Try a newer/better browser.");var fnWhenDone = function (oXML) { alert(oXML.responseText); };myConn.connect("mypage.php", "POST", "foo=bar&baz=qux", fnWhenDone);
http://blog.csdn.net/iambird/archive/2006/05/09/714177.aspx
SAXBuilder builder = new SAXBuilder();
Document xmlDoc = builder.build(is);
Element rootNode = xmlDoc.getRootElement();