【发布时间】:2018-02-06 10:38:08
【问题描述】:
我有一个 API,它适用于以下场景的所有方法,但发布到 IIS 时的更新方法除外。 当我使用时,API的本地路径为http://localhost:87/调用API并且客户成功更新 当我将 API 路径更改为 http://ipaddress 或机器名称时:87/ 提琴手中出现错误,如下所示 内部错误: 消息=未找到路由约定以使用模板“~/entity set/key”为 O 数据路径选择操作。 消息=未找到与请求 URI 'http://ipaddress 或机器名称:87/evolution/Customers(客户的 GUID)'匹配的 HTTP 资源。 下面是 Ajax 调用:
$.ajax({
url: webServiceUrl + "/evol/Customers(" + customerId + ")",
type: "PATCH",
data: customer,
crossDomain: true,
xhrFields: {
withCredentials: true
},
dataType: 'json',
success: function (result) {
debugger;
alert(result.value);
},
error: function (result, request, status, error) {
alert(error);
}
});
【问题讨论】: