mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-15 06:01:04 +00:00
Update http.js
This commit is contained in:
parent
ff00f3cf5b
commit
548929f2ce
12
lib/http.js
12
lib/http.js
|
@ -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:
|
||||||
|
|
Loading…
Reference in New Issue
Block a user