vb POST简单页面数据
POST 这个页面查询数据 http://www.moniker.com/pub/Whois监听到的数据
domain baidu.com
Submit.x 38
Submit.y 19
我的代码 如下: (但是返回不到查询数据)
Dim oXmlHttp As New MSXML2.XMLHTTP
Dim url As String
Dim sPostString As String, sRespText As String
url = "http://www.moniker.com/pub/Whois"
sPostString = "domain=baidu.com" & "&Submit.x=150" & "&Submit.y=100" 'PSOT需要提交的数据
oXmlHttp.open "POST", url, False 'url为处理提交数据的asp页面
oXmlHttp.setRequestHeader "content-type", "application/x-www-form-urlencoded"
oXmlHttp.send sPostString
sRespText = oXmlHttp.responseText '得到处理后response回来的数据
'MsgBox sRespText
Set oXmlHttp = Nothing
Text2 = (sRespText) --------------------编程问答-------------------- 用 ResponseBody 来看看
你可以参考我的博客:
http://blog.csdn.net/supermanking/article/details/5989227 --------------------编程问答-------------------- --------------------编程问答-------------------- http://www.moniker.com/domainsForSaleAjaxServlet?domain=baidu.com
http://www.moniker.com/domainsForSaleAjaxServlet?domain=sina.com
--------------------编程问答--------------------
Private Sub Command1_Click()
Dim http As XMLHttpClass
Dim pUrl As String, pData As String, pRef As String, pCok As String
Dim Data, Header As String
Set http = New XMLHttpClass
pUrl = "http://www.moniker.com/pub/Whois"
pData = "domain=baidu.com&Submit.x=58&Submit.y=13"
pRef = "http://www.moniker.com/pub/Whois"
pCok = ""
Data = http.PostData(pUrl, pData, pRef, pCok, "utf-8", Header)
Text1.Text = Data
Set http = Nothing
End Sub
补充:VB , API