You created an API Gateway REST resource /LandingPage with a GET method using mock integration to serve an HTML landing page that links to your backend APIs. What integration request/response mapping configuration should you use so the API returns HTML content for the landing page?
Choose an answer
Tap an option to check your answer.
Correct answer: Set the integration request mapping template Content-Type to application/json and statusCode to 200. Set the integration response mapping template Content-Type to text/html and include the LandingPage HTML in the response mapping..
Why this is the answer
For a mock integration, the integration request mapping template is used to define the mock data that API Gateway will "receive" internally. Setting its Content-Type to application/json and statusCode to 200 is a standard way to simulate a successful internal request. The actual HTML content for the landing page needs to be returned to the client, so it must be placed in the integration response mapping template. Here, you set the Content-Type to text/html to inform the client that the response body is HTML, and then include the HTML content directly in this template. Incorrect options incorrectly place the HTML content in the request mapping template or set the response Content-Type to application/json, which would not render the page correctly in a browser.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed