question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

I'm receving an error method is invalid

See original GitHub issue

I 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:

https://github.com/http4k/http4k/blob/fd0a19baeb60df5c7f799599324d30591e604579/http4k-serverless/lambda/src/main/kotlin/org/http4k/serverless/ApiGatewayV2.kt#L36

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:closed
  • Created 2 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
daviddentoncommented, May 15, 2021

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.

0reactions
kiquetalcommented, May 15, 2021

Thank you @daviddenton!I’ll look at it Best Regards.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why am I getting an error when entering my credit card ...
Here are some of the most common reasons for errors when entering credit card information: The credit card has expired The credit card......
Read more >
I'm getting an error "invalid use of incomplete type 'class map'
For workaround, create interface class with pure virtual methods for map class. Declare the functions that you are using ( as I see...
Read more >
HTTP invalid method in web services REST job - Discussion
I configured a web services job to use a REST connection profile but am getting an HTTP 405 invalid HTTP method error but...
Read more >
Error: Sending xml with POST results into invalid method ...
Hi all, I'm consuming restful services with WebRequest with following code: var request = WebRequest.
Read more >
Fix issues when you pay for Google products & services
Get an error message when you add a payment method. Find the error code or error message below that you got in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found