1
在檢查HTTP狀態代碼時,我會偶爾看到Python請求模塊和linux curl的結果之間的差異。有時Python請求模塊和wget HTTP響應與curl/Chrome相矛盾
此URL http://www.dagoradiosound.info/site/用curl和chrome瀏覽器返回帶有'requests'和wget但是'200'的'404'。
有沒有人知道我爲什麼得到這些矛盾的結果?
#Python
import requests
url = "http://www.dagoradiosound.info/site/"
r = requests.head(url)
r.status_code
#curl
curl -sL -w "%{http_code} %{url_effective}\\n" "http://www.dagoradiosound.info/site/" -o /dev/null
#wget
wget --spider "http://www.dagoradiosound.info/site/"