mirror of
https://github.com/gnh1201/welsonjs.git
synced 2025-05-09 05:06:04 +00:00
Update http.js
This commit is contained in:
parent
a7613eed6a
commit
ed63417c06
|
@ -270,8 +270,8 @@ var HTTPObject = function(engine) {
|
||||||
this.serialize = function() {
|
this.serialize = function() {
|
||||||
if (this.isJSONRequest() && typeof(this.requestBody) === "object") {
|
if (this.isJSONRequest() && typeof(this.requestBody) === "object") {
|
||||||
return JSON.stringify(this.requestBody);
|
return JSON.stringify(this.requestBody);
|
||||||
} else if (typeof(requestBody) === "object") {
|
} else if (typeof(this.requestBody) === "object") {
|
||||||
return this.serializeURL(this.requestBody);
|
return this.serializeURL(this.evaluate(this.requestBody));
|
||||||
} else {
|
} else {
|
||||||
return this.evaluate(this.requestBody);
|
return this.evaluate(this.requestBody);
|
||||||
}
|
}
|
||||||
|
@ -370,7 +370,7 @@ var HTTPObject = function(engine) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
this.interface.send(this.serialize(this.requestBody));
|
this.interface.send(this.serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Waiting a response
|
// Waiting a response
|
||||||
|
@ -436,7 +436,7 @@ var HTTPObject = function(engine) {
|
||||||
// Add the request body if this is not GET method
|
// Add the request body if this is not GET method
|
||||||
if (this.method !== "GET") {
|
if (this.method !== "GET") {
|
||||||
cmd.push("-d");
|
cmd.push("-d");
|
||||||
cmd.push(this.requestBody);
|
cmd.push(this.serialize());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Add proxy: <[protocol://][user:password@]proxyhost[:port]>
|
// Add proxy: <[protocol://][user:password@]proxyhost[:port]>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user