不,不要尝试在GET请求中发送JSON。将JSON与其他具有主体的动词一起使用,例如POST和PUT。
通过使用
[FromUri]属性装饰您的action参数,以标准方式执行此操作:
public IList<Country> GetCountryList([FromUri] List<long> idList){ ...}然后只需触发AJAX请求即可:
$.ajax({ url: 'api/v1/util/CountryList', type: 'GET', data: { idList: [1, 2, 3] }, traditional: true, success: function (result) { console.log(JSON.stringify(result)); }});进一步建议您阅读有关Web API中的模型绑定如何工作的信息:
http://www.asp.net/web-api/overview/working-with-http/sending-html-form-
data,-part-1



