【发布时间】:2018-12-01 12:21:21
【问题描述】:
我通过邮递员将参数发送到api网关并接收结果。 所以我在 lambda 中尝试了一个简单的例子,
exports.handler = (event, context, callback) => {
// TODO implement
const Idx = event.Idx * 2;
callback(null, Idx);
};
当我发送 Idx 时,它会回调它的两倍。
我在 Body 中选择 raw 并这样做我可以收到结果
但是,我把 "Content-Type" : "application/x-www-form-urlencoded" 放在 Headers 部分,选择 x-www-form-urlencoded,它会返回这个。
{"message": "Could not parse request body into json: Unrecognized token \'Idx\': was expecting \'null\', \'true\', \'false\' or NaN\n at [Source: [B@331a45ec; line: 1, column: 5]"}
我想通过 x-www-formurlencoded 从邮递员那里接收数据。
我该怎么做?
如果你知道,请帮助我。
【问题讨论】:
标签: amazon-web-services aws-lambda postman