问题
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