How to show Rest api response in same page with ftl

Hi Guys,

We have freemaker page which is having Rest call and after clicking submit button we are getting response and redirecting to the next page.

But we want to stay in same page and show the Rest api response, kindly let me know how to do this…

thanks in advance