Update http.js

This commit is contained in:
Namhyeon Go 2022-04-14 17:46:15 +09:00 committed by GitHub
parent ce0fe9f393
commit 66c57f4945
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;