.NET 4 project ... i use this code

Code:
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());
                        }
and i get error

The server committed a protocol violation. Section=ResponseStatusLine

i tried to add

Code:
req.ProtocolVersion = HttpVersion.Version10;
req.KeepAlive = false;