From dca2d4df79c6ec0bb0f196c92dbd81394507dd80 Mon Sep 17 00:00:00 2001 From: John Kurlak Date: Fri, 10 Jul 2015 09:48:49 -0700 Subject: [PATCH] Add method property to ajaxSettings --- jquery/jquery-tests.ts | 5 +++++ jquery/jquery.d.ts | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/jquery/jquery-tests.ts b/jquery/jquery-tests.ts index 3853a8d5f9..1a9a6dd269 100644 --- a/jquery/jquery-tests.ts +++ b/jquery/jquery-tests.ts @@ -119,6 +119,11 @@ function test_ajax() { }).done(function (msg) { alert("Data Saved: " + msg); }); + $.ajax({ + method: "POST", + url: "some.php", + data: { name: "John", location: "Boston" } + }); $.ajax({ url: "test.html", cache: false diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 465323931b..dc5c4ebb68 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -105,6 +105,10 @@ interface JQueryAjaxSettings { * Specify the callback function name for a JSONP request. This value will be used instead of the random name automatically generated by jQuery. It is preferable to let jQuery generate a unique name as it'll make it easier to manage the requests and provide callbacks and error handling. You may want to specify the callback when you want to enable better browser caching of GET requests. As of jQuery 1.5, you can also use a function for this setting, in which case the value of jsonpCallback is set to the return value of that function. */ jsonpCallback?: any; + /** + * The HTTP method to use for the request (e.g. "POST", "GET", "PUT"). (version added: 1.9.0) + */ + method?: string; /** * A mime type to override the XHR mime type. (version added: 1.5.1) */