Jasmine Lognnes Jasmine Lognnes - 1 year ago 143
Perl Question

How to wget/curl past a redirect to download content?

I would like to use

or even use Perl to download a copy of my projects each night from ShareLatex, but when I look at Network in Chrome, I see it redirects from
in a successful login.

Because of the redirect I it flushes the Chrome network debug log, but if I do a wrong login attempt I can see what it sends. See below screenshot.


Can anyone explain how I can figure out which string I should post in order to login?

Is the
header string important?

I have no luck with

curl -s --cookie-jar cookie https://sharelatex.com/login
curl -s --cookie cookie -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login

as it just gives me a failed login screen.

enter image description here

Answer Source

Use -L option in curl:

curl -s -L -H 'email: my@email.com' -H 'password: mypw' https://sharelatex.com/login
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download