The J2ME client sends POST HTTP requests with encoding of packet transfers.
When ASP.NET (both in IIS6 and WebDev.exe.server) tries to read the request, it sets the Content-Length to 0. I think this is normal, because the length of the content is unknown when the request is loaded.
However, when I read Request.InputStream to the end, it returns 0.
Here is the code that I use to read the input stream.
using (var reader = new StreamReader(httpRequestBodyStream, BodyTextEncoding)) { string readString = reader.ReadToEnd(); Console.WriteLine("CharSize:" + readString.Length); return BodyTextEncoding.GetBytes(readString); }
I can simulate client behavior using Fiddler, for example
URL http: // localhost: 15148 / page.aspx
Headers: User Agent: Fiddler Transmission Encoding: Chunked Host: somesite.com:15148
The body of rabbits is rabbits rabbits rabbits rabbits. Thank you for being very helpful!
My body reader on top will return an array of bytes with zero length ... lame ...
Does anyone know how to enable chunked encoding on IIS and ASP.NET Development Server (cassini)?
I found this script for IIS, but it does not work.
source share