Skip to content

Instantly share code, notes, and snippets.

@kenjij
Created February 7, 2020 07:48
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kenjij/350855531fd7e5f0b516b51bf4ae1541 to your computer and use it in GitHub Desktop.
Save kenjij/350855531fd7e5f0b516b51bf4ae1541 to your computer and use it in GitHub Desktop.
Sample: AWS Lambda function event contents received from API Gateway (HTTP API; route: "/event")
{
"version":2,
"path":"/event",
"httpMethod":"GET",
"headers":{
"Content-Length":"0",
"Host":"abcde12345.execute-api.us-west-2.amazonaws.com",
"User-Agent":"curl/7.54.0",
"X-Amzn-Trace-Id":"Root=1-67891233-abcdef012345678912345678",
"X-Forwarded-For":"192.168.1.23",
"X-Forwarded-Port":"443",
"X-Forwarded-Proto":"https",
"accept":"*/*"
},
"multiValueHeaders":{
"Content-Length":[
"0"
],
"Host":[
"abcde12345.execute-api.us-west-2.amazonaws.com"
],
"User-Agent":[
"curl/7.54.0"
],
"X-Amzn-Trace-Id":[
"Root=1-67891233-abcdef012345678912345678"
],
"X-Forwarded-For":[
"192.168.1.23"
],
"X-Forwarded-Port":[
"443"
],
"X-Forwarded-Proto":[
"https"
],
"accept":[
"*/*"
]
},
"queryStringParameters":{
"lang":"en",
"q":"keyword keyword2"
},
"multiValueQueryStringParameters":{
"lang":[
"en"
],
"q":[
"keyword keyword2"
]
},
"requestContext":{
"accountId":"123456789",
"apiId":"abcde12345",
"authorizer":{
"claims":null,
"scopes":null
},
"domainName":"abcde12345.execute-api.us-west-2.amazonaws.com",
"domainPrefix":"abcde12345",
"extendedRequestId":"150c09a55dc2",
"httpMethod":"GET",
"identity":{
"accessKey":null,
"accountId":null,
"caller":null,
"cognitoAuthenticationProvider":null,
"cognitoAuthenticationType":null,
"cognitoIdentityId":null,
"cognitoIdentityPoolId":null,
"principalOrgId":null,
"sourceIp":"192.168.1.23",
"user":null,
"userAgent":"curl/7.54.0",
"userArn":null
},
"path":"/event",
"protocol":"HTTP/1.1",
"requestId":"150c09a55dc2",
"requestTime":"07/Feb/2020:07:16:44 +0000",
"requestTimeEpoch":1581059804950,
"resourceId":null,
"resourcePath":"/event",
"stage":"$default"
},
"pathParameters":null,
"stageVariables":null,
"body":null,
"isBase64Encoded":true
}
{
"version":2,
"path":"/event",
"httpMethod":"POST",
"headers":{
"Content-Length":"34",
"Content-Type":"application/json",
"Host":"abcde12345.execute-api.us-west-2.amazonaws.com",
"User-Agent":"curl/7.54.0",
"X-Amzn-Trace-Id":"Root=1-67891233-abcdef012345678912345678",
"X-Forwarded-For":"192.168.1.23",
"X-Forwarded-Port":"443",
"X-Forwarded-Proto":"https",
"accept":"*/*",
"authorization":"Bearer apikey-123-45678abcde"
},
"multiValueHeaders":{
"Content-Length":[
"34"
],
"Content-Type":[
"application/json"
],
"Host":[
"abcde12345.execute-api.us-west-2.amazonaws.com"
],
"User-Agent":[
"curl/7.54.0"
],
"X-Amzn-Trace-Id":[
"Root=1-67891233-abcdef012345678912345678"
],
"X-Forwarded-For":[
"192.168.1.23"
],
"X-Forwarded-Port":[
"443"
],
"X-Forwarded-Proto":[
"https"
],
"accept":[
"*/*"
],
"authorization":[
"Bearer apikey-123-45678abcde"
]
},
"queryStringParameters":null,
"multiValueQueryStringParameters":null,
"requestContext":{
"accountId":"123456789",
"apiId":"abcde12345",
"authorizer":{
"claims":null,
"scopes":null
},
"domainName":"abcde12345.execute-api.us-west-2.amazonaws.com",
"domainPrefix":"abcde12345",
"extendedRequestId":"150c09a55dc2",
"httpMethod":"POST",
"identity":{
"accessKey":null,
"accountId":null,
"caller":null,
"cognitoAuthenticationProvider":null,
"cognitoAuthenticationType":null,
"cognitoIdentityId":null,
"cognitoIdentityPoolId":null,
"principalOrgId":null,
"sourceIp":"192.168.1.23",
"user":null,
"userAgent":"curl/7.54.0",
"userArn":null
},
"path":"/event",
"protocol":"HTTP/1.1",
"requestId":"150c09a55dc2",
"requestTime":"07/Feb/2020:07:16:44 +0000",
"requestTimeEpoch":1581059804950,
"resourceId":null,
"resourcePath":"/event",
"stage":"$default"
},
"pathParameters":null,
"stageVariables":null,
"body":"{\"key1\":\"value1\", \"key2\":\"value2\"}",
"isBase64Encoded":false
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment