tj / node-querystring

querystring parser for node and the browser - supporting nesting (used by Express, Connect, etc)
MIT License
455 stars 66 forks source link

stringifying numbers fails #23

Closed tj closed 12 years ago

tj commented 12 years ago

ex { limit: ['1', '2'] } is fine but numbers will give you []

ericboehs commented 12 years ago

+1

{ limit: 1 } doesn't work but { limit: '1' } does.

mlegenhausen commented 12 years ago

+1

vlucas commented 12 years ago

Code to reproduce:

 var qs = require('qs');
var request = require('request');

request.post({url: 'http://httpbin.org/post', body: qs.stringify({foo: 'bar', count: 42, bar: 'baz'})}, function(err, res, body) {
  console.log(body);
});

The resulting POST body is foo=bar&count&bar=baz. Notice the &count - the value seems to get dropped completely and inexplicably.

chrisvaughn commented 12 years ago

+1

jturmel commented 12 years ago

+1