2016-07-29 107 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

我仍然只是得到失敗的登錄屏幕... –