AWS Certified Developer – Associate — Question 156
A developer is building an application integrating an Amazon API Gateway with an AWS Lambda function. When calling the API. the developer receives the following error:
Wed Nov 08 01:13:00 UTC 2017 : Method completed with status: 502
What should the developer do to resolve the error?
Answer options
- A. Change the HTTP endpoint of the API to an HTTPS endpoint.
- B. Change the format of the payload sent to the API Gateway.
- C. Change the format of the Lambda function response to the API call.
- D. Change the authorization header in the API call to access the Lambda function.
Correct answer: C
Explanation
The correct answer is C because a 502 error often occurs when the API Gateway receives an invalid response format from the Lambda function. The other options do not address the core issue of the response format, as changing the endpoint or payload format does not resolve the specific response issues from the Lambda function.