// Server-side Model to bind
public class CurrentPipelineRequest
{
public List<string> Usernames { get; set; }
}
// Controller
[HttpPost]
public HttpResponseMessage CurrentPipelineByMilestone(CurrentPipelineRequest currentPipelineRequest)
{
//.....
}
// Jquery/Ajax
var model = {
'Usernames' : JSON.stringify(["me", "you", "I"])
};
$.ajax({
contentType: 'application/json',
type: 'POST',
url: 'api/Dashboard/CurrentPipelineByMilestone'
data: model,
success: function (data) {
alert('success');
}
});
目前,控制器动作参数“currentPipelineRequest”将为空。