Hi Jake,
I did a bit more research on that problem and found the following blog
post about Nginx and chunked encoding:
http://lisp-univ-etc.blogspot.com/2009/04/correcting-content-encodingchunked.html
So it seems to be a known problem. I don't know if it has been already
fixed in newer versions (probably not).
After reading this I decided yesterday night to implement a custom
"light weight" (i. e. not a full featured lib like commons-httpclient).
I needed some customization anyway for PUT and DELETE (as these are not
available in Java ME)... and with that I was able to upload any file
which means that my immediate problem is solved.
Nevertheless, please find attached a sample dialog (request.txt,
response.txt) with chunked encoding (I was using the Sun WTK 2.5.2
emulator on Linux). As far as I remember the emulator sends data in
packets of 2048 bytes. The file I was sending is a text file of ~4K.
As you can see in the request there is no "Content-Length" header entry
and it seems this is what Nginx is complaining about. Although - as of
HTTP 1.1 (I think) - leaving out this header entry is allowed and should
be handled by a compliant server. Actually, I explicitly set the content
length before sending the request, but it seems that the client side
(emulator) HTTP implementation removes this automatically.
Thanks again for your help.
Cheers,
Aleks