My Angular code goes below
var data=['asdfgh','fghjkl','qwerty'];
return $http.post(url, JSON.stringify(data)).then(function (result) {
return result.data;
});
My web api controller is
public class V1MessageController : ODataController
{
[AuthorizeClaims(ClaimTypes.NameIdentifier
[System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1804:RemoveUnusedLocals", MessageId = "messageId", Justification = "Test"), HttpPost]
public IHttpActionResult MarkAsReadMessages(ODataActionParameters odataParameters)
{
//Code for implementation
}
}
If i am passing a simple string,instead of a string of array to same controller method with different parameter it is working fine.
public IHttpActionResult MarkAsReadMessages(Guid key)
{
//Code for implementation
}
Only problem is with string of array.I am unable to pass a string of array to that particular action method.I think this is a compatibility issue of angular with that of ODataController type class member.Please anybody help me out.I am struck with this problem,not able to figure out what to do next.Thanx in advance,