7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Amazon API Gatewayで文字列をクォーテーションなしで返却する

Last updated at Posted at 2015-10-21

Amazon API Gatewayで文字列を返却する時はダブルクォーテーションで囲まれてしまう。

$ curl https://alstvax2jk.execute-api.ap-northeast-1.amazonaws.com/prod/str
"string"

これをクォーテーションなしで返却するには以下の設定が必要。

  1. GET/POST等のResourcesMethod ExecutionIntegration Responseをクリック
    Screenshot 2015-10-20 20.53.51.png

  2. Mapping TemplatesContent-Typeapplication/jsonを追加
    Screenshot 2015-10-20 21.19.58.png

  3. Output PassthroughMapping Templateにし、templateで$input.path('$')と設定
    Screenshot 2015-10-20 20.56.21.png

  4. ボタンで保存

  5. Deploy

これでOK。

$ curl https://alstvax2jk.execute-api.ap-northeast-1.amazonaws.com/prod/str
string

早くawscliで出来るようになりたい。。

参考:
https://forums.aws.amazon.com/thread.jspa?messageID=678603

7
4
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
7
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?