我想到一個WebServiceApi(用於電話應用程序)插入一行到數據庫,但我不能讓它的作品,它不會進入功能。我不能讓工作在MVC上的httpost調用(只有獲取)
我使用Firefox的REST Easy擴展來調用post服務。
我打電話http://localhost:1717/api/Personas
有3個參數idSubvario,idPersona,idinstalacion
但是服務器的迴應是,它不能找到與URI匹配的資源HTTP,如果我改變http://localhost:1717/api/Personas?idSubvario=2&idPersona=2&idInstalacion=5190
它的工作原理,0_o
這是控制器
[System.Web.Mvc.HttpPost]
[System.Web.Mvc.AllowAnonymous]
public ActionResult PostPersonaSubvariosXIDSubvariosYIDPersona(int idSubvario,int idPersona, short idInstalacion)
{
BsPersonas bPersonas = new BsPersonas();
bPersonas.InsertarPersonaSubvario(idSubvario, idPersona, idInstalacion);
EmptyResult er = new EmptyResult();
return er;
}
爲什麼它就像一個GET信訪的功能,如果我說是HttpPost?
的http:// localhost:1717/api/Personas: - 這意味着你在apicontroller中調用一個名爲Personas的函數。但是我可以在這裏看到的是你的函數名稱是不同的。更改並檢查。 – 2015-01-21 09:14:45