Hash: SHA1


On 3/28/2010 10:23 AM, André Warnier wrote:
> For GET and POST requests, both the HTTP RFC and the Servlet Spec
> provide some answers and describe how it is done.
> Basically (and roughly),
> - for a GET (which does not have a body), such request parameters are
> encoded as part of the request URL "query string" part
> - for a POST request (which has a body), the parameters are encoded the
> same way, but are contained in the HTTP body of the request.

... and, for completeness, POST requests may also have GET-style URL
parameters which are merged-together with those gathered from the POST
body so the servlet doesn't have to consult two different "places" for
parameter values.

> In fact, the HTTP RFC definition of a PUT request seems to indicate that
> the body contains the "resource" that the client wants the server to
> store at the location corresponding to the indicated request URL.


> Reading the PUT request body yourself, and parsing it into parameters
> yourself, is on the other hand perfectly supported and should work
> anywhere.

Yup: also, you might be able to write a filter that changes the request
method from PUT to POST in order to trick Tomcat into parsing the
request body for you. That's an ugly hack, but at least you don't have
to go parsing your own request bodies to do that.

On the other hand, using PUT to pass parameters in the body doesn't
sound like it matches any well-known specification, recommendation, or

- -chris
Version: GnuPG v1.4.10 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


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

Reply via email to