[Mono-bugs] [Bug 533575] New: System.Net.HttpWebRequest throws Timeout exception when response is empty

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sun Aug 23 06:49:17 EDT 2009


           Summary: System.Net.HttpWebRequest throws Timeout exception
                    when response is empty
    Classification: Mono
           Product: Mono: Runtime
           Version: 2.0.x
          Platform: i686
        OS/Version: Ubuntu
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: io-layer
        AssignedTo: lupus at novell.com
        ReportedBy: kenneth at hexad.dk
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; da-DK; rv:
Gecko/2009080315 Ubuntu/9.04 (jaunty) Firefox/3.0.13

When issuing a HttpWebRequest I always get a TimeoutException when the response
has no body, eg. for PUT, HEAD or DELETE requests.

Reproducible: Always

Steps to Reproduce:
Sample code:
try {

    System.Net.HttpWebRequest req =

    req.Method = "HEAD"; //Comment this out, and it works

    System.Net.HttpWebResponse resp =


catch (Exception ex) { 


Actual Results:  
System.Net.WebException: The request timed out
  at System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult)
  at System.Net.HttpWebRequest.GetResponse () [0x00000] 
  at Program.Main (System.String[] _args) [0x0001b] in /home/test/Program.cs

Expected Results:  
I am guessing that this happens because the server response has an empty body
and no content length. Using the MS implementation, everything works as

I have not tried Mono 2.4 yet. Any workarounds are appreciated.

Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.

More information about the mono-bugs mailing list