How can we pass array type data from ajax to web API.
Web API -
public HttpResponseMessage SearchFileByIDs([FromBody]string[] values){
.....
....
...
}
Ajax call -
We get fruits id in web api parameter values -
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Mar 18, 2019, 8:36 AM
Jenith ThakkarPosted Mar 18, 2019, 8:11 AM
Suppose if you want to pass it in 0 and 1 then you need to do like below
let fruits=[];
fruits[0]=["5c86296afce2d453a8c27d1c"];
Madan ShekarPosted Mar 18, 2019, 6:36 AM