Kyle Brantley wrote:
...
My point, is that it is entirely possible for a browser to POST data to a resource without sending it as multipart/form-data or application/x-www-form-urlencoded.
Hey! that is cheating. You never mentioned Javascript before.
;-)

But true. I wasn't thinking of XMLHttpRequest (which is becoming entirely misnamed these days). You /can/ POST any body which strikes your fancy.

And you are also right when you mention that assembling a real multipart/form-data body may be a p. in the a.

The real question however is whether you /should/.
(In the sense that you /can/ also do a GET or POST with an unparseable query string, but it would not get you far).

My point (awaiting a more expert opinion still), is that I believe that the way the servlet spec is written, you may very well get away with it under one servlet container, but not under another. Now whether this is a concern in your particular circumstances, is for you to know.

I would gladly read the opinion of one of the designers though.

As an aside : in your case, there is also not much stopping you from sending your XML body in a way guaranteed to work in all cases.
You could send it as
name=........ all your XML, properly URL-encoded ..........

Then it would work also with getParameters().

Unless it is really long of course; I would not recommend this with a file. But in that case, there is this :

http://commons.apache.org/fileupload/using.html

which also allows you to handle multipart/form-data containing blobs and simple form parameters, together in one POST. (Mentioning it because I have often found that what is at the beginning a simple case where "all we need to upload, ever, is a single blob", turns out in the end to be "..but we'd also like to send some additional meta-data describing the blop").




---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to