Skip to content

Conversation

@bantic
Copy link
Contributor

@bantic bantic commented Jun 29, 2011

This uses qs.stringify to turn options.body into a string if it is an object in Browser.post. I am not sure the best way to determine if a variable is an object so I used Object.prototype.toString.call(options.body) (which I saw used in node-querystring (https://github.com/visionmedia/node-querystring/blob/master/lib/querystring.js#L17).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to abstract these out a little with an object mapping content types to functions say something like:

exports.stringify['application/x-www-form-urlencoded'] = qs.stringify

so then we could have application/json etc

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants