我已阅读document:
的 followRedirect
- follow HTTP 3xx responses as redirects (default: true). This
property can also be implemented as function which gets response object as a
single argument and should return true if redirects should continue or false
otherwise.
但是设置followRedirect
let options = {
url: url,
method: 'GET',
headers: {
'user-agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61.0.3163.100 Safari/537.36',
},
followRedirect: function (resp) {
return false;
},
};
设置不起作用。当我得到200时,response.statusCode
应该是307。