Closed HumanRupert closed 3 years ago
@akhtariali can you confirm the version of Mangum you are using?
@jordaneremieff 0.10.0
I updated the API to only receive encoded parameters and then decode them to dictionaries. But I'm not sure if it's a proper solution.
The part of code that appears to be problematic is present since the first commit on adapter.py
. See: https://github.com/jordaneremieff/mangum/blob/96bb9a8b359139f77dea7d4ab25e8c980e13f312/mangum/adapter.py#L252
When I make requests from Postman, it works fine. When I use the test function in the AWS Lambda dashboard, it gives me this error. I send the data as raw JSON in Postman.
@akhtariali this is expected behavior when invoking requests directly using Lambda Proxy integration in the AWS Lambda test console, but when using Postman the API Gateway integration is handling the request so it does not run into this issue.
In the AWS test console, you would have to use an escaped JSON string for the body like this:
"body": "{\"foo\":\"bar\"}"
Request:
Response:
What causes the error?
mangum/blob/main/mangum/adapter.py line 150