Hi All,

Here's what I'm trying (got this code from MSDN):

Dim objSrvHTTP
Dim objXMLSend
Dim objXMLReceive
Set objSrvHTTP = Server.CreateObject("Msxml2.ServerXMLHTTP.3.0")
Set objXMLSend = Server.CreateObject("Msxml2.DOMDocument.3.0")
Set objXMLReceive = Server.CreateObject("Msxml2.DOMDocument.3.0")

objXMLSend.async = false
objXMLSend.loadXML ("<msg><id>2</id></msg>")

objSrvHTTP.open
"POST","http://172.17.12.30/EEntryGateway/default.aspx",false
objSrvHTTP.send (objXMLSend)
Response.ContentType = "text/html"
Response.Write (objSrvHTTP.responseText)


The code executes fine, and on my calling page, I get the results of
the requested page (default.aspx) back. However, from the page that
was called, I can't figure out where the data I'm posting is going. It
doesn't appear in the Form collection anywhere...

What am I doing wrong? How do I sent POST data?

Re: Trying to post data to another server by joshbeall

joshbeall
Tue Apr 11 12:17:44 CDT 2006

Ok, I did some packet captures to see what was happening, and here's
what I did to (it seems) correct things:

objSrvHTTP.setRequestHeader "Content-Type",
"application/x-www-form-urlencoded"
objSrvHTTP.open
"POST","http://172.17.12.30/EEntryGateway/default.aspx",false
objSrvHTTP.send ("ID=2&referer=SomeOtherPage.htm")

Then default.aspx appeared to receive the ID and referer variables
fine, as shown from the tracing output:

Form Collection
Name Value
ID 2
referrer SomeOtherPage.htm