HttpWebRequest

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi All

Can anyone know how to convert following ASP statement into .NET commands? I want to know what class in .NET is equivalent to the XMLHTTP.open command. Thanx

fileName = request("fileName"
Set xDom = Server.CreateObject("Microsoft.XMLDOM"
xDom.async = FALS
Set xh = Server.CreateObject("Microsoft.XMLHTTP"
xh.open "POST", "htttp://www.abc.com/xmreurn.aspx", FALS
xDom.Load fileNam
xh.Send xDom.XM
rtn = xh.Responsetex
Set xh = Nothin
Response.Write(rtn

RC
 
Hello RCK,

Try this:

string filename = Request.QueryString["fileName"];
XmlDocument xDom = new XmlDocument();
xDom.Load(filename);

System.Net.WebClient wc = new System.Net.WebClient();
byte[] response = wc.UploadData("http://www.abc.com/xmreurn.aspx",
"POST",
Encoding.UTF8.GetBytes(xDom.InnerXml));
Response.Write(Encoding.UTF8.GetString(response));
 
Back
Top