Jquery 向typeahead中的远程请求添加数据

Jquery 向typeahead中的远程请求添加数据,jquery,typeahead,Jquery,Typeahead,我正在使用typeahead 0.9.3,并尝试将其配置为使用ASP.NET WebMethod。我已经验证了web方法是否有效 我在配置typeahead以发出正确请求时遇到问题 <script type="text/javascript"> $('.search').typeahead([ { name: "site_search", remote: { url: "/AjaxProxy.aspx/GetTopSea

我正在使用typeahead 0.9.3,并尝试将其配置为使用ASP.NET WebMethod。我已经验证了web方法是否有效

我在配置typeahead以发出正确请求时遇到问题

<script type="text/javascript">
$('.search').typeahead([
    {
        name: "site_search",
        remote: {
            url: "/AjaxProxy.aspx/GetTopSearchTerms",
            beforeSend: function (jqXhr, settings) {
                var data = new Object();
                data.term = "test";
                data.count = "5";

                jqXhr.overrideMimeType("application/json;charset=utf-8");
                settings.type = 'POST';
                //settings.contentType = 'application/json;charset=utf-8';
                settings.data = JSON.stringify(data);
                return true;
            },
            filter: function (data) {
                console.log(data);                    
                return data;
            }
        }            
    }
]);
</script>
我现在有两个问题,我不确定它们是否相关

当我在开发者工具中查看请求时,它并没有发送请求负载。 它也不包括内容类型头,但我不确定这是否是因为没有有效负载。