QuestionQ117

VerifiedTroubleshooting and Optimization

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?

Explanation

A 502 Bad Gateway error from API Gateway indicates the service received an invalid or malformed response from the Lambda function. Lambda must return a properly formatted JSON response object with statusCode, headers, and body properties. HTTPS vs HTTP (A), payload format (B), and authorization headers (D) are not the issue.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!