Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Default to setting Content-Type when Browser#post options includes body. #41

Merged
merged 1 commit into from Jun 28, 2011

Conversation

Projects
None yet
2 participants
Contributor

bantic commented Jun 28, 2011

Default to setting Content-Type when Browser#post options includes body. Default is 'application/x-www-form-urlencoded'

This seems to be the intended behavior when making a Browser#post call, because in the README it includes this code block:

browser.post('/login', { body: 'foo=bar' }, function(res, $){

});

Unless that includes also explicitly sets the content-type to 'application/x-www-form-urlencoded', though, express (at least) won't recognize the body.
This commit by default sets the headers['Content-Type'] to 'application/x-www-form-urlencoded' if options.body is present (and headers['Content-Type'] wasn't explicitly set).

Default to setting Content-Type when Browser#post options includes bo…
…dy. Default is 'application/x-www-form-urlencoded'
Member

tj commented Jun 28, 2011

doh. merged

tj added a commit that referenced this pull request Jun 28, 2011

Merge pull request #41 from bantic/add_content_type_for_post
Default to setting Content-Type when Browser#post options includes body. [bantic]

@tj tj merged commit ab30af4 into LearnBoost:master Jun 28, 2011

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