Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTTP Post using MSXML2

Status
Not open for further replies.

ErrolDC2

MIS
Apr 6, 2005
43
US
Hi folks.
I'm trying to POST some form data to an application running on a server. This is what my code looks like:

Code:
<%
dim xmlhttp
dim cookie
url = "[URL unfurl="true"]http://localhost/lists/index.php?p=subscribe&id=3"[/URL]
PostStr = "email=erneal@hotmail.com&emailconfirm=erneal@hotmail.com&htmlemail=1&attribute2=Errol&attribute1=Neal&list%5B2%5D=signup&listname%5B2%5D=DFIQ&subscribe=Subscribe+to+the+Selected+Newsletters"
Set xmlhttp = server.CreateObject("MSXML2.ServerXMLHTTP.4.0")

' Indicate that page that will receive the request and the
' type of request being submitted
xmlhttp.Open "GET", url, False
xmlhttp.send
cookie = xmlhttp.getResponseHeader("Set-Cookie")
xmlhttp.Open "POST", url, false
xmlhttp.setRequestHeader "COOKIE", left(cookie,instr(1,cookie,";")-1)
xmlhttp.setRequestHeader "COOKIE", left(cookie,instr(1,cookie,";")-1)
xmlhttp.send (PostStr)

%>

The response I keep getting that it's unable to connect to the server. Now I want to run this server side, and I saw something interesting. When I used ethereal to view http traffic between the two servers, it seemed like the server that I wanted to post data to was communicating back to server I wanted to run the code serverside on port 80. In otherwords, it seemed to me that the communication was reversed.
Can someone help me understand what I'm doing wrong?
 
Resolved! proxy settings were screwed up on the box.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top