curl 命令

有的网址是自动跳转的。使用 -L 参数,curl 就会跳转到新的网址。

curl -L www.sina.com

-L, --location option or do multiple URL transfers on the same invoke. If the file name is exactly a minus ("-"), curl will instead the contents from stdin.

键入上面的命令,结果自动跳转为 www.sina.com.cn

-i

参数可以显示 http response 的头信息,连同网页代码一起。

-I

参数则只显示 http response 的头信息。

-v

参数可以显示一次 http 通信的整个过程,包括端口连接和 http request 头信息。

评论