Add a toggle to Call REST Service to de-activate an automatic re-direct in HTTP 3xx responses and/or make re-directs apparent when they take place. - Mendix Forum

Add a toggle to Call REST Service to de-activate an automatic re-direct in HTTP 3xx responses and/or make re-directs apparent when they take place.

14

Whenever the action ‘Call REST Service’ is used in a Mendix application, the settings you have at your disposal will likely suffice what you need to do: Plenty of methods to authenticate, can add headers at a whim, handle the response in a way to right away do what you need with it.
The REST call also has built-in to interpret a response as an error during a 4xx or 5xx response code, which (if you do need to handle these differently) you can still catch in the error handling. The 2xx goes forward through your happy flow.
But I have not found a way to handle my calls differently in a microflow if this call returns a 3xx. It will right away (if sent correctly) re-direct itself to the 2xx its Location header indicates. Additional note here is that this Location header of the 3xx can not be found, you get send into the re-direct blind with no logging it happened, merely the implication of it..


While not strange that it behaves this way, I do find it a tad griping that a 3rd party software the Mendix documentation suggests using to test API calls (Postman, in this case) actually does allow this re-direct to not take place automatically.

 

Be it as a simple toggle, or retrievable via the http response/headers, I think it can be advantageous to have this re-direct information available when using the REST Call action in the Microflow (and not be forced to write a Java action).
It could stop unwanted extra calls (per instance, to avoid throttling) if intercepted, and the re-direct link can be assessed prior to following it for e.g. security qualms with the actual endpoint.

asked
0 answers