Update http.js

This commit is contained in:
Namhyeon Go 2022-05-13 01:55:39 +09:00 committed by GitHub
parent a7613eed6a
commit ed63417c06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,8 +270,8 @@ var HTTPObject = function(engine) {
this.serialize = function() {
if (this.isJSONRequest() && typeof(this.requestBody) === "object") {
return JSON.stringify(this.requestBody);
} else if (typeof(requestBody) === "object") {
return this.serializeURL(this.requestBody);
} else if (typeof(this.requestBody) === "object") {
return this.serializeURL(this.evaluate(this.requestBody));
} else {
return this.evaluate(this.requestBody);
}
@ -370,7 +370,7 @@ var HTTPObject = function(engine) {
break;
default:
this.interface.send(this.serialize(this.requestBody));
this.interface.send(this.serialize());
}
// Waiting a response
@ -436,7 +436,7 @@ var HTTPObject = function(engine) {
// Add the request body if this is not GET method
if (this.method !== "GET") {
cmd.push("-d");
cmd.push(this.requestBody);
cmd.push(this.serialize());
}
// Add proxy: <[protocol://][user:password@]proxyhost[:port]>