因此,我部署了一个 API(aws api gateway),当我获取调用 url 并填写参数时,出现以下错误:
{"message":"Missing Authentication Token"}
我查看了cloud watch,调用了lambda函数,但是我输入的参数都是空的。我不知道发生了什么。
这是我的调用网址:
https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser
这是包含所有参数的调用 URL:
https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser?username=karan&firstName=karan&lastName=chitnis&email=gmail&profileImageURL=whatever&phoneNumber=555&birthdate=0109
这是我的 api 结构的屏幕截图:
{
"$schema":"http://json-schema.org/draft-04/schema#",
"type":"object",
"properties":{
"email":{"type":"string"},
"birthdate":{"type":"string"},
"firstName":{"type":"string"},
"lastName":{"type":"string"},
"userName":{"type":"string"},
"phoneNumber":{"type":"string"},
"profileImageURL":{"type":"string"}
},
"title":"InputaddUser"
}
我没有将查询字符串参数放入我的方法请求中,我只是添加了此模型。因为我打算将其部署到 android 上。但我想确保它首先适用于调用 url。
更新
这是我将 URL 放入 Postman 时的云 watch 。
这是我的输入主体:
{
"email": "<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="06776175636146616b676f6a2865696b" rel="noreferrer noopener nofollow">[email protected]</a>",
"birthdate": "1/1/1990",
"firstName": "Qazar",
"lastName": "Fbaooqui",
"username": "Caster",
"phoneNumber": "some #",
"profileImageURL":"something"
}
最佳答案
您已将此方法配置为 POST
。当我使用正确的动词请求资源时,它似乎有效:
> curl -XPOST https://mupb23gx76.execute-api.us-west-2.amazonaws.com/userAPI/adduser?username=karan&firstName=karan&lastName=chitnis&email=gmail&profileImageURL=whatever&phoneNumber=555&birthdate=0109
{
"output" : "success"
}
关于android - 如何解决 {"message":"Missing Authentication Token"} 错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41472530/