mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-12 04:31: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.dataType = null;
|
||||
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 = {
|
||||
"enabled": false,
|
||||
"protocol": "http",
|
||||
|
@ -102,7 +102,7 @@ var HTTPObject = function(engine) {
|
|||
data: this.requestBody,
|
||||
contentType: this.contentType,
|
||||
success: callback,
|
||||
async: this.isAsync,
|
||||
async: this.isAsynchronous,
|
||||
error: onError // (request, status, error)
|
||||
});
|
||||
};
|
||||
|
@ -278,8 +278,8 @@ var HTTPObject = function(engine) {
|
|||
return this;
|
||||
};
|
||||
|
||||
this.setUseAsync = function(flag) {
|
||||
this.isAsync = flag;
|
||||
this.setIsAsynchronous = function(flag) {
|
||||
this.isAsynchronous = flag;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -352,11 +352,11 @@ var HTTPObject = function(engine) {
|
|||
// Open
|
||||
switch (this.method) {
|
||||
case "POST":
|
||||
this.interface.open(method, url, this.isAsync);
|
||||
this.interface.open(method, url, this.isAsynchronous);
|
||||
break;
|
||||
|
||||
case "GET":
|
||||
this.interface.open(method, url, this.isAsync);
|
||||
this.interface.open(method, url, this.isAsynchronous);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
Loading…
Reference in New Issue
Block a user