嘿,我正在尝试使用axios
库来请求,这就是我到目前为止所得到的-
axios.get("https://example.com").then(console.log)
但是每次Maximum number of redirects exceeded
都会抛出一个错误
我如何通过增加重定向限制来修复它?
发布于 2020-12-28 13:14:45
您可以通过传递第二个object参数来设置请求配置中的maxRedirects
选项,默认情况下该参数设置为5。您需要确保您的重定向不会导致无限循环。您可以在axios docs中找到其他配置选项。
axios.get("https://example.com", {maxRedirects: 5}).then(console.log);
https://stackoverflow.com/questions/65473222
复制相似问题