awslambdarpc
awslambdarpc copied to clipboard
events.APIGatewayProxyRequest no data
Hi, Thank you very much for your solution. I have issue when lambda receive event from rpc call. the req events.APIGatewayProxyRequest is empty as below. Hence i cannot get req.HTTPMethod or req.QueryStringParameters.
{ Resource: Path: HTTPMethod: Headers:map[] MultiValueHeaders:map[] QueryStringParameters:map[] MultiValueQueryStringParameters:map[] PathParameters:map[] StageVariables:map[] RequestContext:{ AccountID: ResourceID: OperationName: Stage: DomainName: DomainPrefix: RequestID: Protocol: Identity:{ CognitoIdentityPoolID: AccountID: CognitoIdentityID: Caller: APIKey: APIKeyID: AccessKey: SourceIP: CognitoAuthenticationType: CognitoAuthenticationProvider: UserArn: UserAgent: User: } ResourcePath: Authorizer:map[] HTTPMethod: RequestTime: RequestTimeEpoch:0 APIID: } Body: IsBase64Encoded:false }
Can you please share your sample project for reference and testing purpose?
Hello, thanks for your feedback.
These fields are sent to the lambda function as fields in the event JSON, following the events.APIGatewayProxyRequest
structure. This means you can pass these parameters as such:
{
"resource": "/{proxy+}",
"path": "/path/to/resource",
"httpMethod": "GET",
"queryStringParameters": {
"name": "test"
},
"body": "the body is aways a string",
"headers": {"accept-encoding":"gzip"}
}
Closing this issue for inactivity.