I will paste the question here as well
I am trying to call Asp.Net WebApi method declared as:
[HttpPost]
[ActionName("Login2")]
public bool Login(UserInfo userinfo)
{
return userinfo.Username == "sandeepsa" && userinfo.Password ==
"chandra";
}
And from Restangular the code looks like:
var lUserInfo = { Username: this.fEmail, Password: this.fPassword };
this.fLoginService.withConfig(x => x.setDefaultHeaders({
'Content-Type': 'application/json' }))
.all("v1Values").post("Login2", null,
{ userinfo: lUserInfo }).then(
x => {
var lLoggedIn: boolean = x == "true";
this.fSessionService.fUserAuthenticated = lLoggedIn;
if (lLoggedIn) {
this.fLocation.path('/dashboard');
return;
}
Utilities.Dialog.showError('Invalid Email or Password');
});
I get this error:
"OPTIONS http://myserver:7220/api/v1Values 500 (Internal Server Error)"
I just can't get this to work. I can't see userinfo passed in the body.
What am I doing wrong?
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.