mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21:03 +00:00
Update http.js
This commit is contained in:
parent
5882d8ad91
commit
adec1afd75
12
lib/http.js
12
lib/http.js
|
@ -95,16 +95,22 @@ var HTTPObject = function(engine) {
|
|||
};
|
||||
|
||||
this.jqAjax = function(url, callback, onError) {
|
||||
this.setResponseBody(window.jQuery.ajax({
|
||||
var options = {
|
||||
type: this.method,
|
||||
headers: this.headers,
|
||||
url: this.serializeParameters(url),
|
||||
data: this.requestBody,
|
||||
//data: this.requestBody,
|
||||
contentType: this.contentType,
|
||||
success: callback,
|
||||
async: this.isAsynchronous,
|
||||
error: onError // (request, status, error)
|
||||
}).responseText);
|
||||
};
|
||||
|
||||
if (["POST", "PUT", "PATCH"].indexOf(this.method) > -1) {
|
||||
options['data'] = this.requestBody;
|
||||
}
|
||||
|
||||
this.setResponseBody(window.jQuery.ajax(options).responseText);
|
||||
};
|
||||
|
||||
this.isJSONRequest = function() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user