apply URL encoding in RestClient#5840
Conversation
|
This might cause double encoding for people already encoding strings, won't it? |
|
hm, URL encoding of a path seems to be trickier than first thought:
|
I've looked into it and '%' would be encoded as '%25' again, so that would indeed cause trouble for people already encoding urls |
|
So FYI, I was able to fix my problem using the following User defined Java expression: What would need to be done on the Rest Client is to:
So my pull request is not cutting this... :-( |
|
I don't have a test setup, but is the error you are getting with a malformed URL helpful? The only real solution would be to not add Query parameters on the URL, but use Parameters tab which will handle the encoding properly |
|
So I think you are trying to solve a non-issue. Either encode the parameters properly for the URL or use the parameters tab, which will handle it for you. |
|
Hi again, ok, yes, using parameters is the solution! thanks!!! |
|
Hi, sorry, too soon: parameters are not used on GET requests .... :-( |
|
Get should support it as far as I can see |
|
good catch #5849 |




Since the current method of URL encoding is to use a User defined Java Expression (see #5201), I would propose to apply URL encoding in the RestCLient component.
This avoids the need to add an extra step just to do URL encoding, that currently forces a java expression to be written, and run on the janino run-time compiler.
It also prevents users from having to find out they need to do this themselves by running into an "Illegal character in path" error, see https://pentaho.home.blog/2019/05/18/create-url-for-rest-query/ .