LoginSignup
1
3

More than 5 years have passed since last update.

API Gateway => lambdaでxmlのpostを受け取る

Posted at

背景

API Gateway x Lambda x DynamoDBで簡易的にデータを貯めるAPI環境があるとします。

IoTサービスで送信元が色んな形式でデータを送ってくる場合などに、
json形式でデータを送ってくれれば、特に問題ないのですが、デバイスに依存して
xmlなどでPOSTされてくると、API Gatewayでjsonに変換できないと怒られるので、メモ。

スクリーンショット 2017-03-07 12.24.17.png

API Gatewayの統合リクエストでテンプレートに下記を設定すると、
lambdaのeventにjsonが渡ってくる。

{
    "body" : $input.json('$')
}

あとはxmlから頑張って値を取得する。

1
3
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
1
3