【发布时间】:2017-04-23 13:14:00
【问题描述】:
根据http://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-payload-encodings.html
If contentHandling is not defined, and if the Content-Type header of the response and the Accept header of the original request match an entry of the binaryMediaTypes list, API Gateway passes through the body. This occurs when the Content-Type header and the Accept header are the same; otherwise, API Gateway converts the response body to the type specified in the Accept header.
我无法发出发送Accept 标头的原始请求。
如何让我的 AWS API Gateway 以二进制格式返回? (图像/JPEG)。因为我从 s3 发回的图像在最后阶段被转换为文本(因为原始请求缺少 Accept: image/jpeg 标头)。
【问题讨论】:
-
亲爱的 Pakore,您应该接受 Kenneth Rory Dunn 的回答 -> 它有效
标签: http amazon-web-services header binary aws-api-gateway