Reputation: 692
How to use dynamic url for http-request in total.js flow. I am able to get params from route component but how to pass this to http-request url ?
Upvotes: 0
Views: 779
Reputation: 748
It's possible and it's very easy. You can use Code
(better) or Repository
component.
Code
component with this code:// This will be as dynamic argument stored in hidden Flow Message repository:
repository.code = 'sk';
// or you can bind value from received data:
repository.code = value.code; // value === received data
// Continue with processing
send(0, value);
URL: https://restcountries.eu/rest/v2/alpha/{code}
HTTP Request component will replace {code}
for repository.code
value. You can use multiple values. That's all :-)
Upvotes: 0