-
curl獲取Google,可以看出來命令本身不會跟蹤重定向,得到302的狀態(tài)
curl -s -f -I http://www.google.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Location: http://www.google.com.hk/?gfe_rd=cr&dcr=0&ei=bELsWaiZH4q_8QWqgLu4Bw
Content-Length: 272
Date: Sun, 22 Oct 2017 07:02:04 GMT
curl -s -f -I -L http://www.google.com
HTTP/1.1 302 Found
Cache-Control: private
Content-Type: text/html; charset=UTF-8
Referrer-Policy: no-referrer
Location: http://www.google.com.hk/?gfe_rd=cr&dcr=0&ei=c0LsWajsJZfB8AWch7HIBg
Content-Length: 272
Date: Sun, 22 Oct 2017 07:02:11 GMT
HTTP/1.1 200 OK
Date: Sun, 22 Oct 2017 07:02:11 GMT
Expires: -1
Cache-Control: private, max-age=0
Content-Type: text/html; charset=Big5
P3P: CP="This is not a P3P policy! See g.co/p3phelp for more info."
Server: gws
X-XSS-Protection: 1; mode=block
X-Frame-Options: SAMEORIGIN
Set-Cookie: 1P_JAR=2017-10-22-07; expires=Sun, 29-Oct-2017 07:02:11 GMT; path=/; domain=.google.com.hk
Set-Cookie: NID=114=srHUwtCAQUqg5q4WMblmeWFplXbpFPdvLsG33Fvqjpr3QNrqptNo-o0idqaLLI9H8kmFkeji5LVj9y4Stc99KQXIyPdo9w_SgEHhE4KtmOGfmxQk3Tm7pfob7W2Jl1Z6; expires=Mon, 23-Apr-2018 07:02:11 GMT; path=/; domain=.google.com.hk; HttpOnly
Transfer-Encoding: chunked
Accept-Ranges: none
Vary: Accept-Encoding
curl follow redirects
最后編輯于 :
?著作權歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時請結(jié)合常識與多方信息審慎甄別。
平臺聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點,簡書系信息發(fā)布平臺,僅提供信息存儲服務。