Jerome Louvel wrote:
Hi Marc,

[...]

Just a follow up question: for reading the request params I found:

- from the query-string
request.getResourceRef().getQueryAsForm(); // optional param charset
- from the http body
request.getEntityAsForm();

(noticing this last one doesn't have an optional charset param I'm assuming whatever the Content-type header specified will be applied here?)

Exactly!

What I didn't find however is an easy method that returns the combination of both sets in one call (as POST URI's can hold request params in both URI and body, and e.g. servlet API request.getParameters() combines those)

This is indeed a point where we diverge from the Servlet API to come closer
to REST/HTTP: - the query parameters are part of the resource URI
 - the posted form is only a request entity (encoded like URI query params
indeed)

So we prefer to handle them separately. If you have a use case where that
makes sense to combine both, I would be interested to hear about it.


ah ok, thx for confirming then.

I don't have a use case up hand really.

Well: I did encounter situations where request params were passed via POST in both URI and body and the fact that at the same the servlet API returned them in one call didn't turn out to be _inconventient_ either.

At this point I was just noticing the difference between both approaches and making a mental note + questioning if I didn't miss out on anything.


Thx again for your reply.

-marc=


Best regards,
Jerome

Reply via email to