CORS error while making axios.get call

前端 未结 3 1586
春和景丽
春和景丽 2020-12-31 00:30

I\'m using axios to make a axios.get call in my redux action.js file. In my component this action is performed on form submission.

I\'m getting status 200

3条回答
  •  囚心锁ツ
    2020-12-31 01:13

    The problem is not with axios. The issue is with the server. When you serve up data you must add the following headers, before sending it.

    Access-Control-Allow-Origin must be set to *

    Access-Control-Allow-Headers must be set to Origin, X-Requested-With, Content-Type, Accept

提交回复
热议问题