mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-19 16:11:03 +00:00
Update http.js
This commit is contained in:
parent
3ff0e41e0d
commit
d66101db7d
12
lib/http.js
12
lib/http.js
|
@ -15,7 +15,7 @@ var HTTPObject = function(engine) {
|
||||||
this.headers = {};
|
this.headers = {};
|
||||||
this.parameters = {};
|
this.parameters = {};
|
||||||
this.dataType = null;
|
this.dataType = null;
|
||||||
this.userAgent = "WelsonJS/0.1.4-dev (https://github.com/gnh1201/welsonjs)";
|
this.userAgent = "WelsonJS/0.2.3-dev (https://github.com/gnh1201/welsonjs)";
|
||||||
this.isAsync = false;
|
this.isAsync = false;
|
||||||
this.proxy = {
|
this.proxy = {
|
||||||
"enabled": false,
|
"enabled": false,
|
||||||
|
@ -48,6 +48,7 @@ var HTTPObject = function(engine) {
|
||||||
password: ""
|
password: ""
|
||||||
};
|
};
|
||||||
this.isFollowRedirect = true;
|
this.isFollowRedirect = true;
|
||||||
|
this.saveTo = '';
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
if (this.engine == "MSXML") {
|
if (this.engine == "MSXML") {
|
||||||
|
@ -454,6 +455,11 @@ var HTTPObject = function(engine) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// if it is download
|
||||||
|
cmd.push("-o");
|
||||||
|
cmd.push(this.saveTo);
|
||||||
|
|
||||||
|
// set the URL
|
||||||
cmd.push(state.url);
|
cmd.push(state.url);
|
||||||
|
|
||||||
// Get response text
|
// Get response text
|
||||||
|
@ -632,6 +638,10 @@ var HTTPObject = function(engine) {
|
||||||
return this;
|
return this;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.setSaveTo = function(filename) {
|
||||||
|
this.saveTo = filename;
|
||||||
|
};
|
||||||
|
|
||||||
this.create();
|
this.create();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user