dotgnu-pnet
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Pnet-developers] HttpRequest


From: Ross_Mallett
Subject: [Pnet-developers] HttpRequest
Date: Thu, 26 Oct 2006 16:06:05 +1100


I was trying to port an application from MSVC70 C# on Windows to DotGNU Portable.NET 0.7.4 on Linux

(1) I have been having trouble with the WebRequest. My code reads:

    request = (HttpWebRequest)WebRequest.Create (url);
            request.Method = "POST";
            request.AllowWriteStreamBuffering = true;

           Stream reqStream = request.GetRequestStream ();
            writer = new XmlTextWriter (reqStream, null);

...

First problem is the HTTP message created by the Web Request has no Content-Length card - and it should have one.

Checked the source code - it doesn't set it.

Had to modify my server to read to the end of message instead of using the Content-Length to code around this problem.




(2) However, despite the fact that a valid message was sent in reply,

        response = (HttpWebResponse) request.GetResponse ();

hangs.


However, I think

       public virtual WebResponse GetResponse()
        {
                throw new NotSupportedException("GetResponse");
        }


There is nothing wrong with the response. There is no error, just a well-formed HTTP message coming back. The identical Windows code handles it just fine, as does a variant Perl version - and I'm unsure what it is waiting on.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]