Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
John McEleney
/
casperjs
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
ab761929
...
ab761929c79df32b940b840dae45a2d2aed7d43e
authored
2012-05-24 16:07:10 -0700
by
Rafael Garcia
Committed by
Nicolas Perriault
2012-05-27 09:47:13 +0200
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
allowing downloads to be triggered by more than just GET requests
1 parent
aab7d18d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
modules/casper.js
modules/casper.js
View file @
ab76192
...
...
@@ -350,10 +350,10 @@ Casper.prototype.die = function die(message, status) {
* @param String targetPath The destination file path
* @return Casper
*/
Casper
.
prototype
.
download
=
function
download
(
url
,
targetPath
)
{
Casper
.
prototype
.
download
=
function
download
(
url
,
targetPath
,
method
,
data
)
{
var
cu
=
require
(
'clientutils'
).
create
();
try
{
fs
.
write
(
targetPath
,
cu
.
decode
(
this
.
base64encode
(
url
)),
'w'
);
fs
.
write
(
targetPath
,
cu
.
decode
(
this
.
base64encode
(
url
,
method
,
data
)),
'w'
);
this
.
emit
(
'downloaded.file'
,
targetPath
);
this
.
log
(
f
(
"Downloaded and saved resource in %s"
,
targetPath
));
}
catch
(
e
)
{
...
...
Please
register
or
sign in
to post a comment