|
| XMLHTTP equivalent in .NET |
|
|
|
|
| Messages |
|
Related Types |
This message was discovered on ASPFriends.com 'aspngxml' list.
| Tim Curtin |
I want to remote a URL query to SQL Server. What is the namespace equivalent in .NET for the XMLHTTP object? Thanks,
Tim
[Original message clipped]
_________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com
|
|
|
| |
|
| |
| | |
| |
| Kirk Allen Evans |
There's not one, it follows the Request and Response framework in .NET. Here is a quick example: You need to supply the URL to post to and the string to post.
HttpWebRequest objRequest = (HttpWebRequest)WebRequest.Create(url); objRequest.Method = "POST"; objRequest.ContentType = "application/x-www-form-urlencoded"; objRequest.ContentLength = strPost.Length;
myWriter = new StreamWriter(objRequest.GetRequestStream()); myWriter.Write(strPost); myWriter.Close();
HttpWebResponse objResponse = (HttpWebResponse)objRequest.GetResponse(); using (StreamReader sr = new StreamReader(objResponse.GetResponseStream()) ) { // sr something sr.Close(); }
Kirk Allen Evans http://www.xmlandasp.net "XML and ASP.NET", New Riders Publishing http://www.amazon.com/exec/obidos/ASIN/073571200X
[Original message clipped]
|
|
|
| |
|
|
| |
|
|
|
|
|
|
|
|
BootFX
Reliable and powerful .NET application framework. |
|
|
|
|
|
|