-
Notifications
You must be signed in to change notification settings - Fork 113
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
Changed .field to use .send instead. #97
Conversation
instead of .field('foo', 'bar') It should be saying .send({foo: 'bar'})
Issue #86 |
Thank you for the PR @BenAychh! I just reviewed #86 and I think there might be something else going on here. According to the SuperAgent documentation, I believe the POST variables are still being sent when I just ran a quick test using a multipart-aware HTTP Post Dumping Service, and it detected the POST variable that I set via it("test", function (done) {
chai.request("http://posttestserver.com")
.post("/post.php")
.field("APPLES", "BANANAS")
.end(function (err, res) {
console.log(res);
done();
});
}); Therefore, I think the documentation should instead be updated to indicate that Also, @Doogiemuc @C00bra @keithamus Does this sound like a fair plan? |
Sounds perfectly fine for me. Thank you for the deep and thorough analysis. I vote for merging your pull request. happy |
I believe using chai.request(app).post('/user/login').type('form').send({username, email}) |
@barraponto Because what you say actually does work:
Thanks, @barraponto. |
@wzup I suspect he looked at the superagent documentation which is the underlying module powering chai-http. There are doubtlessly problems in this plugin's documentation; the creator hasn't been active in 4+ years. The documentation may have been correct that long ago. This plugin is 100% maintained by the community. If you wish to make it better and keep it current, please open a PR with corrections. |
Should we update the PR to include |
Thanks for your work here @BenAychh and @barraponto 👏 |
@barraponto thank you so much for pointing out |
instead of
.field('foo', 'bar')
It should be saying
.send({foo: 'bar'})