2016-07-29 108 views
1

我想用wgetcurl甚至使用Perl每天晚上从ShareLatex下载我的项目的一个副本,但是当我在Chrome看网络,我把它从/login重定向到/projects在成功登录。如何通过重定向wget/curl来下载内容?

由于重定向我刷新了Chrome网络调试日志,但如果我做了错误的登录尝试,我可以看到它发送了什么。看下面的截图。

问题

谁能解释我怎么能弄清楚我应该张贴,以登录该字符串?

_csrf头字符串是否重要?

我有

curl -s --cookie-jar cookie https://sharelatex.com/login 
curl -s --cookie cookie -H 'email: [email protected]' -H 'password: mypw' https://sharelatex.com/login 

没有运气,因为它只是给了我一个失败的登录屏幕。

enter image description here

+1

“?是_csrf头字符串重要。”是。如果您的请求没有发送,网站会认为请求是伪造的。 –

回答

1

使用-L选项curl

curl -s -L -H 'email: [email protected]' -H 'password: mypw' https://sharelatex.com/login 
+0

我仍然只是得到失败的登录屏幕... –