[Mono-devel-list] HttpWebRequest problem

Gonzalo Paniagua Javier gonzalo at ximian.com
Wed Feb 18 06:53:52 EST 2004


El mié, 18-02-2004 a las 04:24, Namit Dhameja escribió:
> Hi all,
>     I am having a problem while sending out "HttpWebRequest". The
> problem is unless you close the output stream the message is not
> getting sent, so the response stream basically times out. Flushing the
> stream also does not send the message. Sample code 
>  
> /// <summary>
> /// Serialize SOAP data.
> /// Set the content length of the string being posted.
> /// </summary>
> protected Stream stmRequest;
> public void sendHttpData()
> {
>  stmRequest = req.GetRequestStream();
>  byte[] b = ASCIIEncoding.Default.GetBytes(messageToSend);
>  stmRequest.Write(b,0,b.Length);
>  stmRequest.Flush();
>  stmRequest.Close ();   // -------------Had to be added <WORKAROUND>
> }
>  
> Could someone suggest me any other way, is this a well know problem?.

That's not a bug. It's a feature. MS .NET behaves that way.

-Gonzalo

 





More information about the Mono-devel-list mailing list