我已按照本教程使用 Azure 移动服务进行自定义身份验证。我的服务已经启动并运行了一段时间,但我现在开始实际实施客户端数据存储库。
因此,当我从 iOS 客户端测试自定义 API register.js 时,我无法使用出现以下错误的日志。

我不明白,因为 register.js 已经到位。我有时也使用 GIT 源代码控制来远程编辑自定义 API 文件。
我的 Xamarin 客户端代码如下。
public async Task<string> RegisterUser (string email, string password)
{
try
{
JObject registerJObject = new JObject();
registerJObject.Add("email", email);
registerJObject.Add("password", password);
JToken response = await MobileService.InvokeApiAsync("register", registerJObject, HttpMethod.Post, null);
string status = response["Status"].Value<string>();
if (status == FAIL)
{
// failed, do something
}
else if (status == SUCCESS)
{
string token = response["token"].Value<string>();
// do something with the token
}
return status;
}
catch (MobileServiceInvalidOperationException ex)
{
throw;
}
}
仍在报告错误等,但您遇到了问题,这是一个内部 500 错误,我可以在上面的屏幕截图中看到日志。