[Mono-bugs] [Bug 573241] New: HttpWebRequest disallows writing to the request stream for certain http methods

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Fri Jan 22 17:31:02 EST 2010



           Summary: HttpWebRequest disallows writing to the request stream
                    for certain http methods
    Classification: Mono
           Product: Mono: Class Libraries
           Version: 2.6.x
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: System
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: anthony.taranto at gmail.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---
           Blocker: ---

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US)
AppleWebKit/532.0 (KHTML, like Gecko) Chrome/ Safari/532.0

I'm porting a C# application to Mono that connects to a REST web service. The
REST API expects an http DELETE request with an xml document as the request
body. .NET allows a call to HttpWebRequest.GetRequestStream() regardless of the
request method.

Mono does not allow anything to be written to the request stream due to the
following code:

bool send = !(method == "GET" || method == "CONNECT" || method == "HEAD" ||
    method == "TRACE" || method == "DELETE");
if (method == null || !send)
    throw new ProtocolViolationException ("Cannot send data when method is: " +

Reproducible: Always

Steps to Reproduce:
Please run attached test case. On .NET the request will be constructed and sent
while on mono, GetRequestStrea() will thrown a ProtocolViolationException.

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

More information about the mono-bugs mailing list