Open joernroeder opened 9 years ago
If someone knows how to do it with PhantomJS, I can look into adding it.
PhantomJS has support for sending whatever encoding you want, but you have to encode the data yourself.
I wonder if we could provide a built-in way to do it. Maybe there's a node module to take a json object and turn it into a form encoded object or something.
I'm not sure how the interface would look. With multipart/form-data
, you can specify headers for each part of the body.
If a form exists on the page , the function should be able to just manipulate the DOM to fill it out and submit it. I was originally envisioning some more like horseman's current .post
that would not rely on there actually being a form to fill.
I am not sure which version is "better", whatever that means.
I think I will add an action for filling (and submitting?) a form on the page simmilar to the CasperJS .fill()
as a todo for v3.
I am also considering something like allowing giving an object to .post()
and having horseman multipart/form-data
encode it.
Do either/both of these sound good @joernroeder and @johntitus?
Looks like https://www.npmjs.com/package/form-data or https://www.npmjs.com/package/form-urlencoded might be useful for this.
How do you think this should work @wong2? The .fill()
way, the .post()
way, or something else?
do you have any plans to add support for
multipart/form-data
(Multipart Form Uploads)?