[Mono-list] System.Net.HttpWebRequest using a System.IO.MemoryStream as a buffer

Gonzalo Paniagua Javier gonzalo.mono at gmail.com
Fri Jan 27 10:45:57 UTC 2012


On Fri, Jan 27, 2012 at 10:45 AM, Robert Jordan <robertj at gmx.net> wrote:
> On 27.01.2012 02:33, Maurício Linhares wrote:
>>
>> And here is the code I'm using ->  https://gist.github.com/1676771
>
>
> Since you're use KeepAlive = true, HttpWebRequest must be able
> to compute the Content-Length header value. It does it by using
> a memory stream.
>
> You may want to try this:
>
> httpRequest.KeepAlive = false;
> httpRequest.AllowWriteStreamBuffering  = false;

If you still want to keep the connection alive, you can set
httpRequest.ContentLength to the proper value or set SendChunked=true
and leave KeepAlive set to true.

-Gonzalo


More information about the Mono-list mailing list