How to confiqure query param for call REST microflow - Mendix Forum

How to confiqure query param for call REST microflow

0

I want to call REST service (GET) using microflow. How can I confiqure query param to the microflow?

Directly placing the params in url using template for brand and size (urlEncoded) results in following url

http://localhost:50901/product/rest/v3/shoes?brand=My+brand%26size=5 

whereas expected is

http://localhost:50901/product/rest/v3/shoes?brand=My%20brand%26size=5

 

How can I achieve this?

asked
2 answers
2

The replacement symbols for <space>: (%20 and +) are equivalent when encoding a URL query string. See this SO question and answer:

https://stackoverflow.com/questions/2678551/when-to-encode-space-to-plus-or-20

If the responding REST service cannot handle this, it should be fixed.

If you actually need %20, you have 2 options:

  1. Wrap the urlEncode() function in a replace() function that replaces + with %20
  2. That said, you can also download the Rest Services module from the app store. It contains a Java Action that does URL encoding and uses %20 for <space>
answered
0

First determine parameters $MyBrand and $size and their values and then pass the parameters along in the location like this:

.

answered