sendpost.asp by Chris Garrett
1 <%
2
3 Response.write(sendPost("http://www.aspalliance.com/chrisg/tools/outputvars.asp","test=Yay!"))
4
5
6 Function sendPost(URL,POST)
7
8 on error resume next
9 Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
10 if err then
11 Response.Write("<p>Error: " & err.description & "<p>")
12 Response.End
13 end if
14
15 ' Call the remote machine the request
16 objXML.open "POST", URL, False
17 objXML.SetRequestHeader "Content-Type", "application/x-www-form-urlencoded"
18 objXML.send(POST)
19
20 ' return the response
21 sendPost = objXML.responSetext
22
23 ' clean up
24 Set objXML = Nothing
25
26 End Function
27
28 %>