Copied from https://aspnet.codeplex.com/workitem/8186
Vote number: 5
The global default value (set with jQuery.ajaxSetup) for "type" is overriden with "GET" in $("form[data-ajax=true]").live("submit"
and in $("a[data-ajax=true]").live("click"
Also:
X-HTTP-Method-Override/X-Requested-With are added in options.data instead of option.headers
In $("a[data-ajax=true]").live("click" the type is forced to GET and data reset to an empty array [], ignoring global options.
Comments: * jQuery.ajaxSetup is meant to provide default values for jQuery's XHR requests. By specifying a request type or an empty data in unobtrusive-ajax.js, we're not violating the contract for ajaxSetup. One approach to fixing your issue would be to create custom AjaxHelper options which sets the HttpMethod to "POST" by default. * Sending the X-Requested-With and X-HTTP-Method-Override headers as a data (query) parameter is a design choice meant to work around incorrectly configured proxies that might strip off non standard headers. * We've fixed the "this" issue as part of https://aspnetwebstack.codeplex.com/workitem/1487
Vote number: 5
The global default value (set with jQuery.ajaxSetup) for "type" is overriden with "GET" in $("form[data-ajax=true]").live("submit"
and in $("a[data-ajax=true]").live("click"
Also:
X-HTTP-Method-Override/X-Requested-With are added in options.data instead of option.headers
In $("a[data-ajax=true]").live("click" the type is forced to GET and data reset to an empty array [], ignoring global options.
Comments: * jQuery.ajaxSetup is meant to provide default values for jQuery's XHR requests. By specifying a request type or an empty data in unobtrusive-ajax.js, we're not violating the contract for ajaxSetup. One approach to fixing your issue would be to create custom AjaxHelper options which sets the HttpMethod to "POST" by default. * Sending the X-Requested-With and X-HTTP-Method-Override headers as a data (query) parameter is a design choice meant to work around incorrectly configured proxies that might strip off non standard headers. * We've fixed the "this" issue as part of https://aspnetwebstack.codeplex.com/workitem/1487