Reputation: 21
I am working with Velocity Template Language. I want to invoke a rest api to get the response using VTL. How can I call an external rest api to get the data using Velocity Template Language?
Upvotes: 0
Views: 1130
Reputation: 4150
If you have the Velocity Tools in your context, you can use the JsonTool
or the XmlTool
(depending on the API return format).
#set($result = $json.fetch('https://your/rest/api')
Upvotes: 0