linux - 如何 wget/curl 通过重定向以下载内容?

标签 linux bash perl curl wget

我想使用 wgetcurl 甚至使用 Perl 每晚从 ShareLatex 下载我的项目副本,但是当我在 Chrome 中查看网络时,我看到它在成功登录时从 /login 重定向到 /projects

由于重定向,我刷新了 Chrome 网络调试日志,但如果我进行了错误的登录尝试,我可以看到它发送的内容。请参见下面的屏幕截图。

问题

任何人都可以解释我如何确定我应该发布哪个字符串才能登录吗?

_csrf header 字符串重要吗?

我没有运气

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

因为它只是给我一个失败的登录屏幕。

enter image description here

最佳答案

curl 中使用 -L 选项:

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

关于linux - 如何 wget/curl 通过重定向以下载内容?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38662297/

相关文章:

linux - 插入街道 sed

linux - 你如何在 Linux 中组装、链接和运行 .s 文件?

bash - 如何使用 while read line with tail -n

perl - 为什么 Perl 的 "sort"不按数字顺序放置这些哈希键?

perl - 如何使用 Perl 修改现有的 Excel 工作簿?

linux - 内部连接两个文本文件

linux - 关闭 linux 然后关闭电源的正确方法是什么?

linux - 打印 file1 到 file2 的差异而不删除 file2 中的任何内容

bash - 如何在跳过一些文件和目录的同时移动文件

regex - 什么 Perl 正则表达式可以匹配数字 12345 的连续子集?