When executing a testvia the AWS API Gateway console, I see that the output response from the Lambda function is correctly transformed:
{
"type" : "",
"message" : "",
"request-id" : ""
}
See logs below:
Tue Sep 06 14:46:06 UTC 2016 : Endpoint request body after transformations: {}
Tue Sep 06 14:46:06 UTC 2016 : Endpoint response body before transformations: {"errorMessage":"501stef"}
Tue Sep 06 14:46:06 UTC 2016 : Endpoint response headers: {x-amzn-Remapped-Content-Length=0, x-amzn-RequestId=a4540f42-7440-11e6-90ce-214b29fcde38, Connection=keep-alive, Content-Length=26, Date=Tue, 06 Sep 2016 14:46:06 GMT, Content-Type=application/json}
Tue Sep 06 14:46:06 UTC 2016 : Method response body after transformations: {
"type" : "",
"message" : "",
"request-id" : ""
}
Tue Sep 06 14:46:06 UTC 2016 : Method response headers: {Content-Type=application/json}
Tue Sep 06 14:46:06 UTC 2016 : Successfully completed execution
Tue Sep 06 14:46:06 UTC 2016 : Method completed with status: 501
However when calling the API via Postman with headers:
Content-Type : application/json
Accept : application/json
No output transformation is happening, and the output JSON message is just:
{
"errorMessage": "501stef"
}
Partly related to Amazon APi gateway fails to generate transformed request but this one talks about the Request.
Before the changes are externally visible, you need to Deploy the API !
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With