sendpost.asp by Chris Garrett
1<%
2
3Response.write(sendPost("http://www.aspalliance.com/chrisg/tools/outputvars.asp","test=Yay!"))
4
5
6Function sendPost(URL,POST)
7
8on error resume next
9Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")
10if err then
11 Response.Write("<p>Error: " & err.description & "<p>")
12 Response.End
13end 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
26End Function
27
28%>