0
當我嘗試使用NodeJS發出此請求時,爲什麼會收到404錯誤響應?NodeJS請求404但瀏覽器正常工作
// Makes an HTTP request to get the cep data
var HTTPRequest = http.request({
hostname: "psd-mt.org.br",
port: 80,
path: "?page_id=88",
method: "GET",
headers: {
"Accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8",
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11"
}
});
但使用網絡瀏覽器訪問下面的URL工作正常!
http://psd-mt.org.br/?page_id=88