I\'m using an Angular $resource to post a model to a webapi endpoint, but Angular sends the data in the request payload, rather than a JSON body or form parameters. As a res
For me this just worked fine. Below is the server-side code
[HttpPost]
public void Disconnect([FromBody] Models.Users.User model) { ... }
and the requesting client code will be,
var dataToPost ={ id : 3, firstName : 'Test', lastName : 'User', username : 'testuser', isApproved : true, isOnlineNow : true, isChecked: true };
var config = {
headers : {
'Content-Type': 'application/json;charset=utf-8;'
}
}
$http.post(thisIsUrl, dataToPost, config).then(......