简体   繁体   中英

AWS Gateway API and file response

Is it possible for AWS Gateway API to respond with a file (zip file) from a HTTP endpoint integration? I heard somewhere AWS Gateway API doesn't support binary formats but wasn't sure if that was for input or input and output.

I have an existing HTTP endpoint and I want to add AWS Gateway API over it; it currently returns a file (zip) on the response.

You cannot respond with a Zip(any binary type) file using API Gateway so far. (As stated in AWS official forum )

As a work around, you can store your file on S3 and dispatch the link of the file using API Gateway.

Binary payloads are not yet natively supported as API Gateway currently encodes content as UTF-8. For the purposes of serving files, serving them via S3 may be an appropriate workaround. You could configure your API to return a link to S3 or to redirect to the public S3 URL.

Thanks, Ryan

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM