Troubleshooting and Optimization

An API Gateway REST API returns HTTP 502 with “Malformed Lambda proxy response.” What should the developer check first?

Show the answer

Correct answerB. The Lambda response structure

AWhy not this: Request throttling normally produces HTTP 429, not a malformed-response error.

BWhy this is right: API Gateway rejects a proxy response that does not follow its required response structure.

CWhy not this: The execution role controls access to AWS resources, not the structure of the function's returned response.

DWhy not this: Reserved concurrency limits invocation capacity rather than determining the response format.

A Lambda proxy response must follow API Gateway's expected structure, including a string body. An execution-role permission failure does not explain an explicitly malformed proxy response.