Update http.js

This commit is contained in:
Namhyeon Go 2022-06-09 12:03:23 +09:00 committed by GitHub
parent ff00f3cf5b
commit 548929f2ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,7 +21,7 @@ var HTTPObject = function(engine) {
this.parameters = {}; this.parameters = {};
this.dataType = null; this.dataType = null;
this.userAgent = "WelsonJS/0.2.4-dev (" + OS_NAME + "; " + OS_ARCH + "; " + DEVICE_UUID + "; https://github.com/gnh1201/welsonjs)"; this.userAgent = "WelsonJS/0.2.4-dev (" + OS_NAME + "; " + OS_ARCH + "; " + DEVICE_UUID + "; https://github.com/gnh1201/welsonjs)";
this.isAsync = false; this.isAsynchronous = false;
this.proxy = { this.proxy = {
"enabled": false, "enabled": false,
"protocol": "http", "protocol": "http",
@ -102,7 +102,7 @@ var HTTPObject = function(engine) {
data: this.requestBody, data: this.requestBody,
contentType: this.contentType, contentType: this.contentType,
success: callback, success: callback,
async: this.isAsync, async: this.isAsynchronous,
error: onError // (request, status, error) error: onError // (request, status, error)
}); });
}; };
@ -278,8 +278,8 @@ var HTTPObject = function(engine) {
return this; return this;
}; };
this.setUseAsync = function(flag) { this.setIsAsynchronous = function(flag) {
this.isAsync = flag; this.isAsynchronous = flag;
return this; return this;
} }
@ -352,11 +352,11 @@ var HTTPObject = function(engine) {
// Open // Open
switch (this.method) { switch (this.method) {
case "POST": case "POST":
this.interface.open(method, url, this.isAsync); this.interface.open(method, url, this.isAsynchronous);
break; break;
case "GET": case "GET":
this.interface.open(method, url, this.isAsync); this.interface.open(method, url, this.isAsynchronous);
break; break;
default: default: