HttpWebRequest

HttpWebRequest

Post by Nick K » Fri, 20 Sep 2002 06:33:49



I have constructed a WebForm that will issue a POST using HttpWebRequest
when a button is pushed. Using StreamWriter, I am able to send a XML String.

On the web page that receives the POST, I want to handle the Request by
loading the XML DomDocument sent in the Request. The code that I am modeling
this after is ASP code and uses Server.CreateObject in a VBScript.

My question is::
1. Do I have to write this Request handling code in the <Script></Script> or
<% %> section of the aspx page? Can I write code in the Page_Load event to
handle this?

Here is the ASP script that I want to duplicate:

dim bOK, oDom, sTemp, bSuccess
oDom = server.CreateObject("Msxml2.DOMDocument.4.0")
oDom.async = false
oDom.setProperty "ServerHTTPRequest", true bOK = oDom.load(Request)
sTemp = oDom.selectSingleNode("//Product_Family").Text
'if bSuccess = reply from *Cash (true/false)
Response.Write(bSuccess)
set oDom = nothing