Amazon Web Services · api · fg-0175

event.httpMethod and event.path are undefined in a Lambda behind an API Gateway HTTP API

If you see event.httpMethod is undefined, the cause and the fix for Amazon Web Services are below, last verified 2026-10-15.

Verified Oct 2026trust 50/100
Symptom
event.httpMethod is undefinedevent.multiValueHeaders and event.multiValueQueryStringParameters are missingHandler written for a REST API or ALB routes everything to the default branch
Cause
HTTP APIs created in the console use payload format 2.0, which moves the method and path to requestContext.http and rawPath. Format 2.0 also merges duplicate headers and query strings with commas.
Fix
Read the 2.0 fields, or set the integration payloadFormatVersion to 1.0 if the handler expects the REST API shape. The CLI, CloudFormation and SDKs require you to choose it explicitly.
Apply
const method = event.requestContext?.http?.method ?? event.httpMethod; const path = event.rawPath ?? event.path; # or keep the old shape aws apigatewayv2 update-integration --api-id $API --integration-id $INT --payload-format-version 1.0
Affected
API Gateway HTTP APIs (apigatewayv2) with payload format version 2.0, the console default
Sources

Last verified 2026-10-15 · Confirmed by 0 builders

Related traps

Have your agent know this before it fails

$ /plugin marketplace add getfootgun/footgun
$ /plugin install footgun@footgun