[Mono-bugs] [Bug 81432][Nor] New - Authorization field in WebHeaderCollection is not set

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Mon Apr 23 14:58:10 EDT 2007

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by bcamps at aastra.com.


--- shadow/81432	2007-04-23 14:58:10.000000000 -0400
+++ shadow/81432.tmp.27948	2007-04-23 14:58:10.000000000 -0400
@@ -0,0 +1,51 @@
+Bug#: 81432
+Product: Mono: Class Libraries
+Version: 1.2
+OS: Red Hat 8.0
+OS Details: 
+Status: NEW   
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs at ximian.com                            
+ReportedBy: bcamps at aastra.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+Summary: Authorization field in WebHeaderCollection is not set
+Description of Problem:
+Although positionning the authorization field within webheadercollection, 
+this is not transmetted on the net (see with ethereal). so we can't send 
+request to securized server.
+here is my code 
+string url = "myIpAdress";
+HttpWebRequest req = (HttpWebRequest) WebRequest.Create(url);
+req.KeepAlive = false;
+// Define the request access method. 
+req.Method = "POST";
+//prepare the password and login
+string sOut = "MyLogin"+":"+"MyPassword";
+byte[] bytValue = System.Text.ASCIIEncoding.UTF8.GetBytes(sOut);
+sOut = System.Convert.ToBase64String(bytValue, 0, bytValue.Length);
+req.Headers["Authorization"] = "Basic " + sOut;
+//I also try with this code but it doesn't work
+//req.Headers.Set("Authorization", "Basic " + sOut);
+//req.Headers.Add("Authorization", "Basic " + sOut );
+//send the request
+HttpWebResponse result = (HttpWebResponse) req.GetResponse();
+Additional Information:
+In All case the webserver send a 401 response and I have an exception.

More information about the mono-bugs mailing list