I'm receving an error method is invalid
See original GitHub issueI was studying the aws-lambda-example from the guide, but I found the following exception when I was testing using the AWS APIGateway console.
Request: Endpoint request body after transformations: {“resource”:“/{proxy+}”,“path”:“/”,“httpMethod”:“POST”,“headers”:null,“multiValueHeaders”:null,“queryStringParameters”:null,“multiValueQueryStringParameters”:null,“pathParameters”:null,“stageVariables”:null,“requestContext”:{“resourceId”:“4x0fo0”,“resourcePath”:“/{proxy+}”,“httpMethod”:“POST”,“extendedRequestId”:“fW7cSGyJIAMFz7g=”,“requestTime”:“15/May/2021:07:05:24 +0000”,“path”:“/{proxy+}”,“accountId”:
Response:
Endpoint response body before transformations: {"errorMessage":"**method is invalid**","errorType":"java.lang.IllegalStateException","stackTrace":["org.http4k.serverless.ApiGatewayV2AwsHttpAdapter.toHttp4kRequest(ApiGatewayV2.kt:37)","org.http4k.serverless.ApiGatewayV2AwsHttpAdapter.invoke(ApiGatewayV2.kt:53)","org.http4k.serverless.ApiGatewayV2AwsHttpAdapter.invoke(ApiGatewayV2.kt:34)","org.http4k.serverless.ApiGatewayFnLoader$invoke$1.invoke(ApiGatewayFnLoader.kt:21)","org.http4k.serverless.ApiGatewayFnLoader$invoke$1.invoke(ApiGatewayFnLoader.kt:12)","org.http4k.serverless.AwsLambdaEventFunction.handleRequest(AwsLambdaEventFunction.kt:15)"]}
Looking at this file:
I think the problem occurs when the code receives “httpMethod”:“POST”, and the code is expecting the lowercase ‘m’
I apologize for my broken english. Best Regards.
Issue Analytics
- State:
- Created 2 years ago
- Comments:5 (3 by maintainers)
Top GitHub Comments
We support all of them - just pick which class you want to extend from - they are all in the same package 🙃.
And btw Rest is only available on V1 - it’s frustrating that the API gateway console only has the v1 message.
Thank you @daviddenton!I’ll look at it Best Regards.