Monday, 15 May 2017

casperjs response headers content-length 0

Using Casperjs i am downloading some apk from remote server but getting and empty apk (0 bytes).

try {
        this.echo("Attempting to download file ");
        var fs = require('fs');
        var appUrl = 'http://website.com/download/someapp.apk';
        casper.download(appUrl, fs.workingDirectory+'/'+'newApk.apk');
    } catch (e) {
        this.echo(e);
    }

And I am getting this in response Headers.

Server: nginx/1.10.2
Date: Mon, 15 May 2017 06:49:10 GMT
Content-Length: 0
Connection: keep-alive
X-Robots-Tag: noindex
Location:http://website.com/download/someapp.apk
Expires: Thu, 01 Jan 1970 00:00:01 GMT
Cache-Control: no-cache, max-age=0, no-cache, no-store, must-
revalidate, proxy-revalidate, no-transform
Pragma: no-cache



via Neeraj kaushik

No comments:

Post a Comment