mirror of
https://github.com/sigmasternchen/webcli
synced 2025-03-15 06:08:54 +00:00
better version of request (now we can add key-value-pairs to data via .setData())
This commit is contained in:
parent
df0ecc611d
commit
4e6b5362ce
1 changed files with 2 additions and 2 deletions
|
@ -8,8 +8,8 @@ Request.prototype.type = "GET";
|
|||
Request.prototype.file = "";
|
||||
Request.prototype.data = "";
|
||||
Request.prototype.setData = function(array) {
|
||||
for (var i = 0; i < array; i++) {
|
||||
this.data += (this.data.length == 0 ? "" : "&") + encodeURIComponent(array[i]);
|
||||
for (var i = 0; i < array.length; i++) {
|
||||
this.data += (this.data.length == 0 ? "" : "&") + encodeURIComponent(array[i][0]) + "=" + encodeURIComponent(array[i][1]);
|
||||
}
|
||||
}
|
||||
Request.prototype.send = function(synchron, after) {
|
||||
|
|
Loading…
Reference in a new issue