On 1/16/07, J.J. Larrea <[EMAIL PROTECTED]> wrote:
>POST:
> if( multipart ) {
> read all form fields into parameter map.
This should use the same req.getParameterMap as for GET, which Servlet 2.4 says
is suppose to be automatically by the servlet container if the payload is
application/x-www-form-urlencoded; in that case the input stream should be null.
Unfortunately, curl puts application/x-www-form-urlencoded in there by
default. Our current implementation of updates always ignores that
and treats the stream as binary.
An alternative for non-multipart posts could check the URL for args,
and if they are there, treat the body as the input instead of params.
$ curl http://localhost:5000/a/b?foo=bar --data-binary "hi there"
$ nc -l -p 5000
POST /a/b?foo=bar HTTP/1.1
User-Agent: curl/7.15.4 (i686-pc-cygwin) libcurl/7.15.4 OpenSSL/0.9.8d zlib/1.2.
3
Host: localhost:5000
Accept: */*
Content-Length: 8
Content-Type: application/x-www-form-urlencoded
hi there
-Yonik