Amazon API Gateway: o corpo da resposta não é transformado quando a API é chamada via Postman?
Ao executar um teste no console do AWS API Gateway, vejo que a resposta de saída da função Lambda é transformada corretamente:
{
"type" : "",
"message" : "",
"request-id" : ""
}
Veja os logs abaixo:
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
No entanto, ao chamar a API via Postman com cabeçalhos:
Content-Type : application/json
Accept : application/json
Nenhuma transformação de saída está acontecendo e a mensagem JSON de saída é apenas:
{
"errorMessage": "501stef"
}
Parcialmente relacionado aO gateway Amazon APi falha ao gerar solicitação transformada mas este fala sobre oSolicitação.