I have been trying to download a file that come as an attachment from a POST, that is made by a button click. I submit this form, that generate some params (that are not human-friendly), that are only used in the POST to the server.
In Firefox or Chrome, after I click the button a download dialog appears, so I think that the best way to solve this is by setting the headless browser to auto-download, but I can't find a way to do this.
After I click the download button I get this warning from CasperJS:
[warning] [phantom] Loading resource failed with status=fail (HTTP 200): https://myurl.com/report/detail/export