I try to pass an array of object from angular to mvc webapi via post method but with no success.
This is my client code:
$http({
url: '/api/messages/graph',
data: { users: siteService.siteObject.users },
method: 'Post'
})
This is my mvc web api controller (Try with [FromBody]
attribute and without)
[Authorize(Roles = "admin")]
[HttpPost]
public List<graph_item> graph([FromBody] DaganUser[] users)
{
...
}
In the browser console seems that the data pass to server, But the controller parameter always null