allowing downloads to be triggered by more than just GET requests
Showing
1 changed file
with
2 additions
and
2 deletions
... | @@ -350,10 +350,10 @@ Casper.prototype.die = function die(message, status) { | ... | @@ -350,10 +350,10 @@ Casper.prototype.die = function die(message, status) { |
350 | * @param String targetPath The destination file path | 350 | * @param String targetPath The destination file path |
351 | * @return Casper | 351 | * @return Casper |
352 | */ | 352 | */ |
353 | Casper.prototype.download = function download(url, targetPath) { | 353 | Casper.prototype.download = function download(url, targetPath, method, data) { |
354 | var cu = require('clientutils').create(); | 354 | var cu = require('clientutils').create(); |
355 | try { | 355 | try { |
356 | fs.write(targetPath, cu.decode(this.base64encode(url)), 'w'); | 356 | fs.write(targetPath, cu.decode(this.base64encode(url, method, data)), 'w'); |
357 | this.emit('downloaded.file', targetPath); | 357 | this.emit('downloaded.file', targetPath); |
358 | this.log(f("Downloaded and saved resource in %s", targetPath)); | 358 | this.log(f("Downloaded and saved resource in %s", targetPath)); |
359 | } catch (e) { | 359 | } catch (e) { | ... | ... |
-
Please register or sign in to post a comment