我正在尝试通过 odata 从数据库中删除一个条目。我收到错误消息
{"error":{"code":"","message":{"lang":"en-US","value":"Bad Request - 查询语法错误。"}}}
我的代码:
function deleteMonthEntry() {
var item = actMonthEntries.getItem(listIndex);
var queryString = "Stundens(" + item.data.datensatz_id + ")?$format=json";
var requestUrl = serviceUrl + queryString;
WinJS.xhr({
type: "delete",
url: requestUrl,
headers: {
"Content-type": "application/json"
}
}).done(
function complete(response) {
},
function (error) {
console.log(error);
}
);
}
我的请求 URL 如下所示:
requestUrl = "http://localhost:51893/TimeSheetWebservice.svc/Stundens(305233)?$format=json"
谢谢马洛