Skip to content

Commit 4ecd3f0

Browse files
committed
Serialize nested objects same way as node
1 parent 2097cd2 commit 4ecd3f0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

lib/client.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ function pushEncodedKeyValuePair(pairs, key, val) {
9595
return val.forEach(function(v) {
9696
pushEncodedKeyValuePair(pairs, key, v);
9797
});
98+
} else if (isObject(val)) {
99+
for(var subkey in val) {
100+
pushEncodedKeyValuePair(pairs, key + '[' + subkey + ']', val[subkey]);
101+
}
102+
return;
98103
}
99104
pairs.push(encodeURIComponent(key)
100105
+ '=' + encodeURIComponent(val));

0 commit comments

Comments
 (0)