How can I http post data to any page in the web in Classic ASP?
+1
A:
Try this:
Set xmlhttp = Server.CreateObject("Microsoft.ServerXMLHTTP")
xmlhttp.Open "POST", "http://yoursite", false
xmlhttp.Send data
Response.Write xmlhttp.ResponseText
Rubens Farias
2009-11-09 08:40:21
Don't use XMLHTTP in ASP, use ServerXMLHTTP as @Jakkwylde indicates.
AnthonyWJones
2009-11-09 23:30:01
fixed, ty Anthony
Rubens Farias
2009-11-10 08:12:59
+2
A:
I'd suggest ServerXMLHTTP
over XmlHttp
for the reasons below:
XMLHTTP is designed for client applications and relies on URLMon, which is built upon Microsoft Win32 Internet (WinInet). ServerXMLHTTP is designed for server applications and relies on a new HTTP client stack, WinHTTP. ServerXMLHTTP offers reliability and security and is server-safe.
http://support.microsoft.com/kb/290761
Example:
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
Jakkwylde
2009-11-09 18:37:34