##// END OF EJS Templates
Add ajax contentType parameters...
Thomas Kluyver -
Show More
@@ -117,6 +117,7 b' define(function(require) {'
117 processData : false,
117 processData : false,
118 type : "POST",
118 type : "POST",
119 data: data,
119 data: data,
120 contentType: 'application/json',
120 dataType : "json",
121 dataType : "json",
121 };
122 };
122 return utils.promising_ajax(this.api_url(path), settings);
123 return utils.promising_ajax(this.api_url(path), settings);
@@ -181,6 +182,7 b' define(function(require) {'
181 processData : false,
182 processData : false,
182 type: "POST",
183 type: "POST",
183 data: JSON.stringify({copy_from: from_file}),
184 data: JSON.stringify({copy_from: from_file}),
185 contentType: 'application/json',
184 dataType : "json",
186 dataType : "json",
185 };
187 };
186 return utils.promising_ajax(url, settings);
188 return utils.promising_ajax(url, settings);
@@ -195,6 +197,7 b' define(function(require) {'
195 var settings = {
197 var settings = {
196 type : "POST",
198 type : "POST",
197 dataType : "json",
199 dataType : "json",
200 contentType: false, // no data
198 };
201 };
199 return utils.promising_ajax(url, settings);
202 return utils.promising_ajax(url, settings);
200 };
203 };
@@ -213,6 +216,7 b' define(function(require) {'
213 var url = this.api_url(path, 'checkpoints', checkpoint_id);
216 var url = this.api_url(path, 'checkpoints', checkpoint_id);
214 var settings = {
217 var settings = {
215 type : "POST",
218 type : "POST",
219 contentType: false, // no data
216 };
220 };
217 return utils.promising_ajax(url, settings);
221 return utils.promising_ajax(url, settings);
218 };
222 };
@@ -196,6 +196,7 b' define(['
196 cache: false,
196 cache: false,
197 type: "POST",
197 type: "POST",
198 data: JSON.stringify({name: this.name}),
198 data: JSON.stringify({name: this.name}),
199 contentType: 'application/json',
199 dataType: "json",
200 dataType: "json",
200 success: this._on_success(on_success),
201 success: this._on_success(on_success),
201 error: this._on_error(error)
202 error: this._on_error(error)
@@ -278,6 +279,7 b' define(['
278 processData: false,
279 processData: false,
279 cache: false,
280 cache: false,
280 type: "POST",
281 type: "POST",
282 contentType: false, // no data
281 dataType: "json",
283 dataType: "json",
282 success: this._on_success(on_success),
284 success: this._on_success(on_success),
283 error: this._on_error(error)
285 error: this._on_error(error)
@@ -319,6 +321,7 b' define(['
319 processData: false,
321 processData: false,
320 cache: false,
322 cache: false,
321 type: "POST",
323 type: "POST",
324 contentType: false, // no data
322 dataType: "json",
325 dataType: "json",
323 success: this._on_success(on_success),
326 success: this._on_success(on_success),
324 error: this._on_error(on_error)
327 error: this._on_error(on_error)
@@ -121,6 +121,7 b' define(['
121 cache: false,
121 cache: false,
122 type: "POST",
122 type: "POST",
123 data: JSON.stringify(this._get_model()),
123 data: JSON.stringify(this._get_model()),
124 contentType: 'application/json',
124 dataType: "json",
125 dataType: "json",
125 success: this._on_success(on_success),
126 success: this._on_success(on_success),
126 error: this._on_error(on_error)
127 error: this._on_error(on_error)
@@ -168,6 +169,7 b' define(['
168 cache: false,
169 cache: false,
169 type: "PATCH",
170 type: "PATCH",
170 data: JSON.stringify(this._get_model()),
171 data: JSON.stringify(this._get_model()),
172 contentType: 'application/json',
171 dataType: "json",
173 dataType: "json",
172 success: this._on_success(success),
174 success: this._on_success(success),
173 error: this._on_error(error)
175 error: this._on_error(error)
General Comments 0
You need to be logged in to leave comments. Login now