Update http.js

This commit is contained in:
Namhyeon Go 2022-06-09 14:00:59 +09:00 committed by GitHub
parent 5882d8ad91
commit adec1afd75
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -95,16 +95,22 @@ var HTTPObject = function(engine) {
}; };
this.jqAjax = function(url, callback, onError) { this.jqAjax = function(url, callback, onError) {
this.setResponseBody(window.jQuery.ajax({ var options = {
type: this.method, type: this.method,
headers: this.headers, headers: this.headers,
url: this.serializeParameters(url), url: this.serializeParameters(url),
data: this.requestBody, //data: this.requestBody,
contentType: this.contentType, contentType: this.contentType,
success: callback, success: callback,
async: this.isAsynchronous, async: this.isAsynchronous,
error: onError // (request, status, error) 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() { this.isJSONRequest = function() {