ReactJS: No 'Access-Control-Allow-Origin' header with XMLHttpRequest

后端 未结 2 1185
耶瑟儿~
耶瑟儿~ 2021-01-23 02:54

The code below gives the next error. I\'ve set the header. I found the problem lies in CORS but couldn\'t find how to make it work. In the commented I tried to send request with

2条回答
  •  悲&欢浪女
    2021-01-23 03:14

    You need to allow the whitelist header "http://localhost:3000" on you Google developer account.

    or

    Try changing the dataType: 'jsonp' in your ajax call.

提交回复
热议问题