Axios call api with GET become OPTIONS

后端 未结 2 1179
春和景丽
春和景丽 2021-01-12 10:42

I use axios for calling API (in front-end). I use the method \"GET\" :

import axios from \'axios\';
import querystring from \'querystring\';

var url   = \"m         


        
2条回答
  •  Happy的楠姐
    2021-01-12 11:15

    So the way to solve this npm install qs.

    Then:

    import qs from 'qs'
    
    function send(params) {
      return axios.post('/api/create/', qs.stringify(params))
    }
    

提交回复
热议问题