Amazon API gateway — proxied requests are returning unreadable data

筅森魡賤 提交于 2019-12-11 05:49:20

问题


We have recently begun exploring Amazon's api gateway service, and I have configured a few apis with explicit mapping. These function as expected.

However, the proxy mapping seems to be returning unexpected/unreadable content.

This is what we get:

��������[o�0��J�Ů��-pǡ�j�Bڪ^�ɷīcg�CU��K

Also, this only occurs when we hit it from the application/Postman. Doing test api calls from the gateway dashboard functions as expected.

Does it sound like some configuration is missing? Anyone else experienced this issue?


回答1:


Per the comment from Michael - sqlbot, the issue was with our backend compressing all responses with gzip. AWS Api Gateway does not currently support gzip for proxy http requests. per https://forums.aws.amazon.com/thread.jspa?messageID=747449

We don't currently support gzip. However you can workaround by using a lambda proxy for your POST method (http://docs.aws.amazon.com/apigateway/latest/developerguide/integrating-api-with-aws-services-lambda.html)



来源:https://stackoverflow.com/questions/40661591/amazon-api-gateway-proxied-requests-are-returning-unreadable-data

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!