DavidWebb icon indicating copy to clipboard operation
DavidWebb copied to clipboard

cannot add query parameters to put request

Open svrolanski opened this issue 6 years ago • 5 comments

When you use put(), calls to param() are ignored.

svrolanski avatar May 04 '18 20:05 svrolanski

you can use uri += "?" + WebbUtils.queryString(request.params)

arbor95 avatar Aug 29 '18 15:08 arbor95

yes, that is a valid wordaround for it, I think that was what I used, but it is will a bug isn't?

svrolanski avatar Aug 29 '18 17:08 svrolanski

I think you can have a body for put() (same as for post()), where the params go automatically (but I don't know if that is true. For get() you surely have no request body, so params go auto to the queryString of url.).

arbor95 avatar Aug 30 '18 14:08 arbor95

I'm not sure. Having query-params in URL of POST or PUT request can be useful, but AFAIK there are backend stacks which don't support it. At least for application/x-www-form-urlencoded it can be ambiguous.

Does anybody know facts about this?

hgoebl avatar Sep 07 '18 10:09 hgoebl

After some quick reading, it does not seem to break any RFC and I agree with what one said: "The difference between /user/john and /?user=john is merely a semantic one".

https://stackoverflow.com/questions/611906/http-post-with-url-query-parameters-good-idea-or-not

https://stackoverflow.com/questions/14551194/how-are-parameters-sent-in-an-http-post-request/26717908#26717908

svrolanski avatar Sep 10 '18 15:09 svrolanski