I am posting some values from a HTML page to the server via ajax. The value gets send from the Front end, but when the code hits the server, the values are null. Appreciate if someone could give some advice.
I am Using Umbraco Version 6.1.5 with Mvc4 WEb API
Server Side Controller
public class SignInApiController : UmbracoApiController
{
private projectUmbracoContext db = new projectUmbracoContext();
[HttpPost]
public string signInOneOff([FromBody]SignIn model)
{
SignIn signIn = new SignIn();
signIn.EmailId = model.EmailId;
signIn.Password = model.Password;
signIn.AppId = model.AppId;
signIn.RegistrationDate = DateTime.Now;
signIn.AppStatus = true;
db.SignIns.Add(signIn);
db.SaveChanges();
return "success";
}
}
To send value from client to api method I use a test.html page located on desktop
with the following code
The Umbraco Web Api Post Failed
I am posting some values from a HTML page to the server via ajax. The value gets send from the Front end, but when the code hits the server, the values are null. Appreciate if someone could give some advice.
I am Using Umbraco Version 6.1.5 with Mvc4 WEb API
Server Side Controller
To send value from client to api method I use a test.html page located on desktop with the following code
When use this html it actually hits the api but with null values and gives following error in inspect element network tab
Any help would be appreciated
Maybe you could have a look at this example to see what you might be doing wrong: http://www.nibble.be/?p=224
Jeroen
is working on a reply...