Layer7 API Management

 View Only

 return html response

Vladimir Malivan's profile image
Vladimir Malivan posted Jan 19, 2023 05:12 AM
I created a service in GW. ןמ GW I use a route assertion that send request to end point that returns HTML.
I want to return this HTML to the browser so that it displays the page in the browser as an HTML page
Is it possible? How can I do it?
Now the html returns like a text
Aran White's profile image
Broadcom Employee Aran White
if you are using the routing assertion then response should just go back to the client. 
like this
The response may well need some transformation though, The variable that is you would need to edit is ${response.mainpart} this will contain the HTML.
You might need to re-write html links etc (you could use the regex expression for example). If you edit variables or combine other variable you can use the template response assertion, but you would want to set the content type to text/html so that the browser knows its HTML.