A J2ME client is sending HTTP POST requests with chunked transfer encoding.
When ASP.NET (in both IIS6 and WebDev.exe.server) tries to read the request it sets the Content-Length to 0. I guess this is ok because the Content-length is unknown when the request is loaded.
However, when I read the Request.InputStream to the end, it returns 0.
Here's the code I'm using 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 the behaiviour of the client with Fiddler, e.g.
URL http://localhost:15148/page.aspx
Headers: User-Agent: Fiddler Transfer-Encoding: Chunked Host: somesite.com:15148
Body rabbits rabbits rabbits rabbits. thanks for coming, it's been very useful!
My body reader from above will return a zero length byte array...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 isn't working.