While using proxy integration with API Gateway, API Gateway passes the HTTP request to the Lambda in a particular format. Similarly, API Gateway expects the output in a particular format. Refer to the recipe to see how most of these are used in Java code.
The input format is as follows:
{
"resource": "The resource path",
"path": "The path parameter",
"httpMethod": "Incoming request's method name"
"headers": {request headers}
"queryStringParameters": {query string parameters }
"pathParameters": {path parameters}
"stageVariables": {Available stage variables}
"requestContext": {Request context with authorizer-returned key-value pairs}
"body": "A JSON string of the request payload."
"isBase64Encoded": "A boolean flag that indicate if the applicable request payload is Base64-encoded"
}
The output format is as follows:
{
"isBase64Encoded": true|false,
"statusCode": httpStatusCode,
"headers": { headerName: headerValue key value pairs },
"body": "body content"
}