查看完整版本: 解決在SSH command底下 curl抓到404 error,但在瀏覽器中卻正常?


Alex_Chang 2021-2-25 15:34

解決在SSH command底下 curl抓到404 error,但在瀏覽器中卻正常?

有時我們會習慣在command底下用 curl 抓取Header 資訊,但是卻發現有些網站回應 404 錯誤,<br>用Browser 看卻是正常的<br><br># curl -I https://www.tricore.com.tw<br>[quote]<br>HTTP/2 404 <br>date: Thu, 25 Feb 2021 07:25:34 GMT<br>server: Apache<br>expires: Thu, 19 Nov 1981 08:52:00 GMT<br>cache-control: no-store, no-cache, must-revalidate<br>pragma: no-cache<br>set-cookie: PHPSESSID=c47fdaa40021f0a9e34e26be49b66951; path=/; HttpOnly<br>set-cookie: lngID=tw; expires=Fri, 25-Feb-2022 07:25:34 GMT; Max-Age=31536000; path=/<br>content-type: text/html; charset=UTF-8<br>[/quote]<br><br>上網查了一些做法,發現要改用這個參數,就可以正確抓取<br># curl -svo. https://www.tricore.com.tw
頁: [1]
查看完整版本: 解決在SSH command底下 curl抓到404 error,但在瀏覽器中卻正常?