Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Post pathParameters not working #46

Open
erajasekar opened this issue Dec 22, 2017 · 0 comments
Open

Post pathParameters not working #46

erajasekar opened this issue Dec 22, 2017 · 0 comments

Comments

@erajasekar
Copy link

The path parameter configuration in POST is not working and throwing illegal argument exception. The deserialization of Request object seems to be fine from log

2017-12-22 13:54:55 <b0cc97a1-e71f-11e7-99d3-25999fafaac9> DEBUG ResourceMethodInvoker:66 - Request object is: Request{packageName='com.innovativeastrosolutions.astrosoftapi.controllers', method=POST, pathTemplate='/horoscope/{featureSet}', requestBody={"name":"Test","place":{"name":"Tampa","longitude":-82.45843,"latitude":27.94752,"timeZoneId":"America/New_York"},"year":2017,"month":10,"date":14,"hour":6,"minutes":0,"seconds":0,"options":{"Ayanamsa":"LAHARI"}}, pathParameters={featureSet=HoroscopeBasic}, queryParams={}, requestHeaders={Accept=*/*, Accept-Encoding=gzip, deflate, br, Accept-Language=en-US,en;q=0.9, cache-control=no-cache, CloudFront-Forwarded-Proto=https, CloudFront-Is-Desktop-Viewer=true, CloudFront-Is-Mobile-Viewer=false, CloudFront-Is-SmartTV-Viewer=false, CloudFront-Is-Tablet-Viewer=false, CloudFront-Viewer-Country=US, content-type=application/json, Host=api.mydomain.com, origin=null, postman-token=db9e69d3-13be-4a3a-8a4f-a85ab26fccb4, User-Agent=Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36, Via=2.0 6dda9c60465801404125720fa2c0e501.cloudfront.net (CloudFront), X-Amz-Cf-Id=cm2XApN0WVGwqBO63QXgyvnYoevzFx1v0vIIKC8W6MITqCkXoy6qJw==, X-Amzn-Trace-Id=Root=1-5a3d0eaf-3a3573c10de7d64d77132d61, x-api-key=6yVALzMiNk6EDrZXrUUk89RQYDXpN1EK68AR58X3, X-Forwarded-For=47.199.220.129, 52.46.25.71, X-Forwarded-Port=443, X-Forwarded-Proto=https}, consumedMediaType=application/json, producedMediaType=application/json}

But throws the error message:

java.lang.IllegalArgumentException: wrong number of arguments
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.lambadaframework.runtime.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:148)
at org.lambadaframework.runtime.Handler.handleRequest(Handler.java:62)
at org.lambadaframework.runtime.Handler.handleRequest(Handler.java:13)
at lambdainternal.EventHandlerLoader$PojoHandlerAsStreamHandler.handleRequest(EventHandlerLoader.java:178)
at lambdainternal.EventHandlerLoader$2.call(EventHandlerLoader.java:888)
at lambdainternal.AWSLambda.startRuntime(AWSLambda.java:281)
at lambdainternal.AWSLambda.<clinit>(AWSLambda.java:64)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at lambdainternal.LambdaRTEntry.main(LambdaRTEntry.java:94)

The path params seem to work fine for GET, but not for POST.. Is there any difference between how GET vs POST is implemented..? Any pointers to help troubleshooting further will be greatly appreciated.

Thanks,
Raja.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant