bash `curl -e` 或 `curl --referer` 是什么意思?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/23409952/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
what does `curl -e` or `curl --referer` mean?
提问by taymedee
I've seen some example :-
我看过一些例子:-
curl --referer http://example.com/bot.html http://www.cyberciti.biz/
curl --referer http://example.com/bot.html http://www.cyberciti.biz/
what is the different if I use curl http://www.cyberciti.biz/
如果我使用有什么不同 curl http://www.cyberciti.biz/
shell script type:-
shell 脚本类型:-
curl -e http://example.com/bot.html \
'http://www.cyberciti.biz/'
what is \
for?
是\
为了什么?
回答by Mike Furlender
From the man
pageof cURL
从man
页面的cURL
-e, --referer <URL>
(HTTP) Sends the "Referrer Page" information to the HTTP server. This can also be set with the -H, --header flag of course. When used with -L, --location you can append ";auto" to the --referer URL to make curl automatically set the previous URL when it follows a Location: header. The ";auto" string can be used alone, even if you don't set an initial --referer.
(HTTP) 将“Referrer Page”信息发送到 HTTP 服务器。这当然也可以用 -H, --header 标志设置。与 -L, --location 一起使用时,您可以将“;auto”附加到 --referer URL 后,使 curl 在跟随 Location: 标头时自动设置前一个 URL。";auto" 字符串可以单独使用,即使您没有设置初始 --referer。
Essentially this tells the server which page sent you there.
本质上,这告诉服务器哪个页面将您发送到那里。