AWS Certified Developer – Associate — Question 360
A company has a serverless application that uses Amazon API Gateway backed by AWS Lambda proxy integration. The company is developing several backend APIs. The company needs a landing page to provide an overview of navigation to the APIs.
A developer creates a new /LandingPage resource and a new GET method that uses mock integration.
What should the developer do next to meet these requirements?
Answer options
- A. Configure the integration request mapping template with Content-Type of text/html and statusCode of 200. Configure the integration response mapping template with Content-Type of application/json. In the integration response mapping template, include the LandingPage HTML code that references the APIs.
- B. Configure the integration request mapping template with Content-Type of application/json. In the integration request mapping template, include the LandingPage HMTL code that references the APIs. Configure the integration response mapping template with Content-Type of text/html and statusCode of 200.
- C. Configure the integration request mapping template with Content-Type of application/json and statusCode of 200. Configure the integration response mapping template with Content-Type of text/html. In the integration response mapping template, include the LandingPage HTML code that references the APIs.
- D. Configure the integration request mapping template with Content-Type of text/html. In the integration request mapping template, include the LandingPage HTML code that references the APIs. Configure the integration response mapping template with Content-Type of application/json and statusCode of 200.
Correct answer: C
Explanation
For an Amazon API Gateway mock integration, the integration request mapping template must define a statusCode (such as 200) with a Content-Type of application/json to instruct the mock engine on which response to return. The actual HTML payload for the landing page must be specified in the integration response mapping template under the text/html Content-Type so it is correctly rendered by the client browser. The other options are incorrect because they either put the HTML payload in the request template or mismatch the Content-Types for the request and response.