ApiGwV2HttpEvent: added requestId by mcoup · Pull Request #230 · aws/aws-lambda-java-libs
public class TestHandler implements RequestHandler<APIGatewayV2HTTPEvent, String> { @Override public String handleRequest(APIGatewayV2HTTPEvent apiGatewayV2HTTPEvent, Context context) { System.out.println(apiGatewayV2HTTPEvent.getRequestContext().getRequestId()); return null; } }
{
"version": "2.0",
"routeKey": "ANY /printer",
"rawPath": "/printer",
"rawQueryString": "",
"headers": {
"accept": "*/*",
"content-length": "0",
"host": "abcdef.execute-api.us-west-2.amazonaws.com",
"user-agent": "curl/7.71.1",
"x-amzn-trace-id": "Root=1-60583e5a-1f74381240de6ded5a65dbd0",
"x-forwarded-for": "127.0.0.1",
"x-forwarded-port": "443",
"x-forwarded-proto": "https"
},
"requestContext": {
"accountId": "123456789012",
"apiId": "abcdef",
"domainName": "abcdef.execute-api.us-west-2.amazonaws.com",
"domainPrefix": "abcdef",
"http": {
"method": "GET",
"path": "/printer",
"protocol": "HTTP/1.1",
"sourceIp": "127.0.0.1",
"userAgent": "curl/7.71.1"
},
"requestId": "fakeRequestid=", <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
"routeKey": "ANY /printer",
"stage": "$default",
"time": "22/Mar/2021:06:51:06 +0000",
"timeEpoch": 1616395866990
},
"isBase64Encoded": false
}
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.