Skip to content
New issue

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

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

browser.post json object #64

Open
kof opened this issue Sep 14, 2011 · 0 comments
Open

browser.post json object #64

kof opened this issue Sep 14, 2011 · 0 comments

Comments

@kof
Copy link

kof commented Sep 14, 2011

Hi I have 1 issue and 1 enhancement here :)

Issue:

If I using

data = {
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({bla: ''blubb'})
}

and browser.post(data, cb)

there is an error in connect bodyParser at the point where body will be JSON parsed.

I have debugged - the string is broken, it is shotter then the original string should be.

I investigated further:

headers['Content-Length'] = options.body.length;

It seems that content-length is wrong calculated here ... (I have a large json string hopefully you can reproduce it with any one)

Removing content-length from tobi solves the problem.

Enhancement

I don't want to setup header every time I want post a json object. It can be detected automatically.

I am trying to use tobi for integration tests of the api.

Can we fix this fast? I can provide you a patch.

Best,
Oleg

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

No branches or pull requests

1 participant