mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-11 20:21: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.parameters = {};
|
||||
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.proxy = {
|
||||
"enabled": false,
|
||||
|
@ -48,6 +48,7 @@ var HTTPObject = function(engine) {
|
|||
password: ""
|
||||
};
|
||||
this.isFollowRedirect = true;
|
||||
this.saveTo = '';
|
||||
|
||||
this.create = function() {
|
||||
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);
|
||||
|
||||
// Get response text
|
||||
|
@ -632,6 +638,10 @@ var HTTPObject = function(engine) {
|
|||
return this;
|
||||
};
|
||||
|
||||
this.setSaveTo = function(filename) {
|
||||
this.saveTo = filename;
|
||||
};
|
||||
|
||||
this.create();
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user