无法将POST数据发送到Lambda [英] Cannot send POST data to Lambda
问题描述
我正在尝试将数据发送到我的lambda函数,但是该函数未获取我的数据,event
变量为空.我没有收到任何错误,当我在API网关中测试该功能时,它可以正常工作.所以我不确定发生了什么.我向Lambda发送数据的代码如下.
I am trying to send data to my lambda function however the function is not getting my data, the event
variable is empty. I am not getting any errors and when I test the function in my API Gateway it works fine. So I am not sure what is happening. My code for sending data to Lambda is below.
var options = {
method: 'POST',
url: 'correct api url',
contentType: "application/json",
dataType: "json",
data: s
}
在我的控制台中, 看起来像这样 for 有什么问题吗? 在集成请求"配置中,确保已选中使用Lambda代理集成"复选框. In the "Integration Request" configuration, make sure you've checked the "Use Lambda Proxy integration" checkbox. 并确保您的输出与此处定义的架构匹配,以避免错误: And make sure your output matches the schema defined here to avoid errors:
这篇关于无法将POST数据发送到Lambda的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!data: '{"article_url":"a url here"}'
data: s
within my console looks like this data: '{"article_url":"a url here"}'
推荐答案