webapi GET接口出现List参数,ajax怎么传值
展开全部
这边测试:get方法传递数组如下
http://localhost:62096/api/Search?categoryId=18&type[]=104&type[]=104&type[]=103&type[]=102&pageNumber=1&itemCount=30
webapi接口search中如下:
public SearchDataFormat Search(string categoryId = null, string query = null, [FromUri]string[] type = null, string itCode = null, int day = 0, int pageNumber = 1, int itemCount = 0)
http://localhost:62096/api/Search?categoryId=18&type[]=104&type[]=104&type[]=103&type[]=102&pageNumber=1&itemCount=30
webapi接口search中如下:
public SearchDataFormat Search(string categoryId = null, string query = null, [FromUri]string[] type = null, string itCode = null, int day = 0, int pageNumber = 1, int itemCount = 0)
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询