0
我在使用Azure移動服務的自定義認證中遵循this tutorial。我的服務已經啓動並運行了一段時間,但我現在開始實際實現了一個客戶端數據存儲庫。腳本'/api/register.js'中的錯誤。錯誤:加載api時出錯
因此,當我從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錯誤,我可以在上面的屏幕截圖中看到日誌。
通常,日誌中的錯誤意味着您的js源文件中存在語法錯誤。這聽起來像是從你的問題,你實際上添加register.js文件之前得到這個,所以這是可以預料的。 – phillipv
只需再次檢查腳本,注意到意外按下了一個字符替換設置變量值'。謝謝。 –
@phillipv請回答問題,以便我可以標記爲正確。 –