【发布时间】:2017-07-06 10:43:17
【问题描述】:
我正在密切关注documentation 当我尝试像他们所做的那样创建 api 时。但是当我从邮递员那里拨打电话时,我无法发出 get 请求。
module.exports = {
"get": function (request, response, next) {
try{
var query = {
sql: 'UPDATE EmailVerification SET verified = @completed where id = @unique',
parameters: [
{ name: 'completed', value: request.query.completed,
name: 'unique', value: request.query.unique }
]
};
request.azureMobile.data.execute(query)
.then(function (results) {
console.log(results);
response.json("Verfied successfully");
}).catch(function (err) { console.log(err);
response.send(err);});
}
catch(ex)
{
console.log(ex);
response.send(ex);
}
}
};
在邮递员中,我正在打电话
https://<appname>.azurewebsites.net/api/emailtoken?completed=true&unique=4a642af0-75be-45dd-bd8d-3c91e93a8b9d
任何线索都会有所帮助。
这是输出的截图:
PS:我已经更新了我的问题,提供了更多细节和更改。
【问题讨论】:
-
你说的“我无法得到”是什么意思?你得到了哪个状态码? 4xx 或 5xx 错误?
-
404 not found -
@AaronChen-MSFT 仅供参考:当查询为“Select * from”时,api 调用正在工作,但当我更新它时它不起作用。 - 这可能会有所帮助。
-
@AaronChen-MSFT 我更新了我的问题。希望能给你更多的细节来帮助我解决。
标签: node.js azure azure-mobile-services