Allow passing a hash instead of a string in Browser#post's options.body. #42

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

Contributor
bantic commented Jun 28, 2011

One more...

This changes it so that the "body" option for Browser.post can be a hash rather than a string. Makes tobi easier to use this way (before this I was having to properly escape the string by hand).

Allows one to do:

browser.post('/login', { body: {foo:"b&r",bar:"foo"} }, function(res, $){

});

The test includes the text "b&r" to ensure that the escaping is being done properly.

thanks.

Member
tj commented Jun 28, 2011

we should extend visionmedia/node-querystring (qs in npm) to add a stringify() method, handling the different cases

Contributor
bantic commented Jun 28, 2011

I'll take a look at doing that.

Contributor
bantic commented Jun 28, 2011

I made some changes to node-querystring and issued a pull request there...I'll re-open this later.

@bantic bantic closed this Jun 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment