2009-11-09 19 views

回答

10

我建議ServerXMLHTTP超過XmlHttp原因如下:

XMLHTTP是專爲客戶 應用程序並依賴於URL Mon, 這是基於Microsoft Win32 Internet(WinInet)。 ServerXMLHTTP爲 設計用於服務器應用程序,而 依賴於新的HTTP客戶端堆棧, WinHTTP。 ServerXMLHTTP提供 可靠性和安全性,並且服務器安全性爲 。

http://support.microsoft.com/kb/290761

例子:

DataToSend = "id=1" 
    dim xmlhttp 
    set xmlhttp = server.Createobject("MSXML2.ServerXMLHTTP") 
    xmlhttp.Open "POST","http://localhost/Receiver.asp",false 
    xmlhttp.setRequestHeader "Content-Type", "application/x-www-form-urlencoded" 
    xmlhttp.send DataToSend 
    Set xmlhttp = nothing 
2

試試這個:

Set xmlhttp = Server.CreateObject("Microsoft.ServerXMLHTTP") 
xmlhttp.Open "POST", "http://yoursite", false 
xmlhttp.Send data 

Response.Write xmlhttp.ResponseText 
+0

不要在ASP使用XMLHTTP,使用的ServerXMLHTTP如@Jakkwylde所示。 – AnthonyWJones 2009-11-09 23:30:01

+0

固定,ty安東尼 – 2009-11-10 08:12:59

+0

沒有添加內容類型大多數帖子不會接受這是一個有效的請求 – BradLaney 2012-01-08 23:34:15

0

如果你想重定向POST請求時,您可以使用Server.Transfer的

相關問題