I am using jQuery $ .ajax to make a request to a third-party server using JSONP. I specify the method as POST, but it still uses GET:
$.ajax({ type: "POST", dataType: "json", url: other_server + "/run?callback=?", data: { code: $(code).val() }, success: function(obj) { var res = obj.results; $(results).val(res); } });
Looking at the jQuery source, I see these two lines that seem to force all cross-domain GET requests, but I don't understand why this should be like this:
if ( s.crossDomain ) { s.type = "GET";
Is it possible to do this with POST instead of GET? Why is jQuery forcing GET?
source share