Reactjs 更改响应的标题

Reactjs 更改响应的标题,reactjs,fetch,Reactjs,Fetch,我有一个react app create和create react app。我想向另一个url发送请求: fetch('anotherUrl') .then(response => response.json()) .then(res => console.log(res)) 在那之后,我有一个cors问题。如何将中间件设置为空此错误?您可以使用浏览器插件关闭cors。在你完成应用程序开发并上线后,cors不会成为问题。这是在localhost中运行

我有一个react app create和create react app。我想向另一个url发送请求:

fetch('anotherUrl')
        .then(response => response.json())
        .then(res => console.log(res))

在那之后,我有一个cors问题。如何将中间件设置为空此错误?

您可以使用浏览器插件关闭cors。在你完成应用程序开发并上线后,cors不会成为问题。这是在localhost中运行应用程序时唯一的问题。

可能存在重复的