Environment: WinXP SP2, .Net 2.0, VS 2005
--------------------------------------------------
This is the code chunk
if (url.AbsoluteUri.StartsWith("http://"))
{
HttpWebRequest HttpWReq = (HttpWebRequest)WebRequest.Create(url);
HttpWebResponse HttpWResp = null;
try
{
HttpWResp = (HttpWebResponse)HttpWReq.GetResponse();
result = HttpWResp.StatusCode.ToString();
HttpWResp.Close();
}
catch (WebException webExcp)
{
result = webExcp.Status.ToString();
}
}
-----------------------------------------------------------
If I try to hit Url's like http://msn.com, no issues.
However, when I try to hit http://localhost/capweb, hell breaks loose.
WebException with the following description is thrown:
"webExcp {"The server committed a protocol violation. Section=ResponseHeader
Detail=CR must be followed by LF"} System.Net.WebException"
Why so? How do I fix it?
From the browser, all works fine.
Please help
---------------------
Thanks
Rajiv Das