LoginSignup
0
0

More than 3 years have passed since last update.

【AWS】API Gateway経由でWebアプリにアクセスした際のレスポンスがBase64形式となる

Last updated at Posted at 2019-07-07

はじめに

AWS Lambdaなどに構築したWebアプリにAPI Gateway経由でアクセスした際に、既定の設定ではレスポンスがHTMLコンテンツではなくBase64形式となってしまう。

image.png

このような場合は、API Gatewayの設定でAPIの「バイナリメディアタイプ」を追加する必要がある。

手順

対象のAPIで[設定]-[バイナリメディアタイプ]で[バイナリメディアタイプの追加]をクリックし、text/htmlまたは*/*を指定して、[変更の保存]をクリック。

image.png

設定変更をステージに反映させるためにAPIのデプロイを忘れずに行う。

再度Webアプリにアクセスすると正常にHTMLコンテンツが表示された。

image.png

以上

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0