.NET 4 project ... i use this code
and i get errorCode:Uri uri = new Uri("http://www.test.com:" + port + @"/admin.cgi?pass=" + pass + "&mode=viewxml"); HttpWebRequest req = (HttpWebRequest)WebRequest.Create(uri); req.Credentials = CredentialCache.DefaultCredentials; using (HttpWebResponse res = (HttpWebResponse)req.GetResponse()) { StreamReader sr = new StreamReader(res.GetResponseStream()); }
The server committed a protocol violation. Section=ResponseStatusLine
i tried to add
Code:req.ProtocolVersion = HttpVersion.Version10; req.KeepAlive = false;


Reply With Quote