Bytes to be written to the stream exceed the Content-Length bytes size specified.

Sep 24, 2009 at 4:28 PM

Hello!

When use POST and send especial characters "áéíóúñ" etc, this error happend:

Bytes to be written to the stream exceed the Content-Length bytes size specified.

I have found the problem is with the content length.  This solved the problem for me:

//NTwitter.URLConnectionHttpClient.Post

162     // Append params to post-request
163    string paramlist = GetParamString(vars);
164  
165    //request.ContentLength = paramlist.Length;
166    request.ContentLength = System.Text.Encoding.UTF8.GetByteCount(paramlist); //New line.

Now,  i can send POST with special characters.

Good Library.