mirror of
https://github.com/gnh1201/welsonjs.git
synced 2024-11-26 15:31:42 +00:00
Update http.js
This commit is contained in:
parent
ce0fe9f393
commit
66c57f4945
11
lib/http.js
11
lib/http.js
|
@ -43,8 +43,11 @@ var HTTPObject = function(engine) {
|
||||||
this.connectTimeout = 0;
|
this.connectTimeout = 0;
|
||||||
this.isDebugging = false;
|
this.isDebugging = false;
|
||||||
this.credential = {
|
this.credential = {
|
||||||
method: ""
|
method: "",
|
||||||
|
username: "",
|
||||||
|
password: ""
|
||||||
};
|
};
|
||||||
|
this.isFollowRedirect = true;
|
||||||
|
|
||||||
this.create = function() {
|
this.create = function() {
|
||||||
if (this.engine == "MSXML") {
|
if (this.engine == "MSXML") {
|
||||||
|
@ -379,6 +382,10 @@ var HTTPObject = function(engine) {
|
||||||
if (this.isDebugging) {
|
if (this.isDebugging) {
|
||||||
cmd.push("-v");
|
cmd.push("-v");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (this.isFollowRedirect) {
|
||||||
|
cmd.push("-L");
|
||||||
|
}
|
||||||
|
|
||||||
cmd.push("-X");
|
cmd.push("-X");
|
||||||
cmd.push(this.method);
|
cmd.push(this.method);
|
||||||
|
@ -640,6 +647,6 @@ exports.get = function(url, data, headers) {
|
||||||
return (new HTTPObject()).setHeaders(headers).setParameters(data).setUseCache(false).get(url).responseBody;
|
return (new HTTPObject()).setHeaders(headers).setParameters(data).setUseCache(false).get(url).responseBody;
|
||||||
};
|
};
|
||||||
|
|
||||||
exports.VERSIONINFO = "HTTP Lib (http.js) version 0.3";
|
exports.VERSIONINFO = "HTTP Lib (http.js) version 0.4";
|
||||||
exports.global = global;
|
exports.global = global;
|
||||||
exports.require = global.require;
|
exports.require = global.require;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user