【发布时间】:2016-05-15 18:40:29
【问题描述】:
我正在使用来自 azure 的默认服务器 (.net) 和默认 (uwp) 应用程序来测试移动应用程序系统。
发布服务器并通过应用程序连接到服务器后,我收到消息“请求无法完成。(错误请求)”。我没有修改任何东西。这是从 azure 门户下载的默认项目。
回复是:
{StatusCode:400,ReasonPhrase:“错误请求”,版本:1.1,内容:System.Net.Http.StreamContent,标头:
{
服务器:Microsoft-IIS/10.0
日期:2016 年 5 月 15 日星期日 18:22:48 GMT
X-Powered-By: ASP.NET
x-zumo-服务器版本:net-1.1.157.1
内容长度:228
内容类型:应用程序/json;字符集=utf-8
}}
客户要做的项目:
public class TodoItem
{
public string Id { get; set; }
[JsonProperty(PropertyName = "text")]
public string Text { get; set; }
[JsonProperty(PropertyName = "complete")]
public bool Complete { get; set; }
}
客户端逻辑:
private async void ButtonSave_Click(object sender, RoutedEventArgs e)
{
var todoItem = new TodoItem { Text = TextInput.Text };
TextInput.Text = "";
await InsertTodoItem(todoItem);
}
private async Task InsertTodoItem(TodoItem todoItem)
{
// This code inserts a new TodoItem into the database. When the operation completes
// and Mobile Apps has assigned an Id, the item is added to the CollectionView
await todoTable.InsertAsync(todoItem);
items.Add(todoItem);
//await App.MobileService.SyncContext.PushAsync(); // offline sync
}
我可以做些什么来运行连接/系统?
谢谢
【问题讨论】:
-
有同样的问题。真的很迷茫。以前工作得很好。突然我得到这个错误。我浏览了所有文档,其中一些表明我有权限问题(后端应用程序无法在数据库中生成表)。
标签: c# azure mobile win-universal-app