gpt4 book ai didi

http - 我在 Netlify 上部署我的网站后,来自 newsapi.org 的错误 426

转载 作者:行者123 更新时间:2023-12-04 16:27:00 29 4
gpt4 key购买 nike

当我在本地主机上尝试我的项目时,它运行良好,使用 https://cors-anywhere.herokuapp.com/因为我遇到了 CORS 问题。但是一旦我在 Netlify 上部署了该站点,无论是否使用 https://cors-anywhere.herokuapp.com/,它都会给我错误 426(需要升级)。 .
这些是出现在我的控制台上的消息:

>Failed to load resource: the server responded with a status of 426 (Upgrade Required)

>Error: Request failed with status code 426
at createError.js:16
at settle.js:17
at XMLHttpRequest.<anonymous> (xhr.js:61)

我一直在寻找,有些人似乎有类似的问题。我见过像拥有自己的服务器来传递请求这样的解决方案,但我不知道该怎么做,如果我错了,请纠正我,这与使用 https://cors-anywhere.herokuapp.com/ 不一样。 ?

最佳答案

Newsapi 改变了他们的定价模式。

您不能再从浏览器发出请求,您必须使用后端。我遇到了同样的问题,解决它的最简单方法是实现 Node (Express) 服务器。

关于http - 我在 Netlify 上部署我的网站后,来自 newsapi.org 的错误 426,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62157026/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com