我正在使用帶有Angular和D3 api的MVC的WebApi2的示例項目。我面臨WebApi的一個問題。一切工作正常與本地機器Azure數據庫連接字符串,但當我發佈相同的Azure我的HttpPost停止工作,而HttpGet工作正常。我現在面臨的WebApi HttpPost不能在Windows Azure上工作
[HttpPost]
[Route("api/dashboard/addnewassignment")]
public WebApiD3Sample.ViewModels.CoursePersonAssignmentModel AddNewCoursePersonAssignment([FromBody]WebApiD3Sample.ViewModels.CoursePersonAssignmentModel model)
{
if (ModelState.IsValid) {
var modelAfterSave = AssignmentService.AddAssignment(model);
return modelAfterSave;
}
ModelState.AddModelError("Invalid", "Not a Valid Save");
return model;
}
錯誤發表
Failed to load resource: the server responded with a status of 500 (Internal Server Error)
http://sampledataweb.azurewebsites.net/api/dashboard/addnewassignment
Object
message: "An error has occurred."
__proto__: Object
看起來不是特定於azure的問題,請給出更多詳細信息。 – ssilas777
像什麼細節?這是該網站的網址[http://sampledataweb.azurewebsites.net/](http://sampledataweb.azurewebsites.net/) – RaviMittal