> What is the System.Net.HttpWebRequest equivalent code for the MS XML related
> code below?
> Set oHttpPost = CreateObject("Microsoft.XMLHTTP")
> oHttpPost.Open "POST", "www.MyUrl.com", False
[quoted text clipped - 8 lines]
> St = oHttpPost.responseText
> End If
Check out WebClient and its methods
WebClient client = new WebClient();
string st = client.UploadString("http://example.com/page.aspx",
"<data here>");

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Martin Honnen - 17 Mar 2008 15:25 GMT
> Check out WebClient and its methods
> WebClient client = new WebClient();
Add
client.Headers.Add("Content-Type",
"application/x-www-form-urlencoded");
here
> string st = client.UploadString("http://example.com/page.aspx", "<data
> here>");

Signature
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
John - 17 Mar 2008 15:41 GMT
Hi
Many thanks. Have been reading on WebCLient but can't figure what replaces
oHttpPost.status and oHttpPost.responseText. Have googled to but couldn't
find an equivalent example.
Thanks again.
Regards
>> What is the System.Net.HttpWebRequest equivalent code for the MS XML
>> related
[quoted text clipped - 17 lines]
> string st = client.UploadString("http://example.com/page.aspx", "<data
> here>");
Anthony Jones - 19 Mar 2008 23:01 GMT
> Hi
>
> Many thanks. Have been reading on WebClient but can't figure what replaces
> oHttpPost.status and oHttpPost.responseText. Have googled to but couldn't
> find an equivalent example.
The responseText is the return value of a call such as UploadString().
The status isn't directly available however if a status representing a
problem in 400 or 500 range is received the call will throw a WebException.
If you need further details you can interogate the execption's properties.
For example
((HttpWebResponse)e.Response).StatusCode would get you the status code
returned by the server.

Signature
Anthony Jones - MVP ASP/ASP.NET