2 ms·
API-Gateway can return HTML?
by Scarbutt 7y ago
API-Gateway can return HTML?
- k__ 7y agoSure. You can write Velocity templates for integration responses. Normally they are JSON because that's what all the AWS services return and API-Gateway just passes them along. But you could write something like this: #set($pets = $input.path('$')) <html lang="en"> <head> <meta charset="utf-8"> <title>Pets</title> </head> <body> <table> <th>ID</th> <th>Type</th> <th>Price</th> #foreach($pet in $pets) <tr> <td>$pet.id</td> <td>$pet.type</td> <td>$pet.price</td> </tr> #end </table> </body> </html>