https://stackoverflow.com/questions/39116731/how-to-prevent-axios-from-encoding-my-request-parameters

 

axios.get('https://foobar.com/api', {
  paramsSerializer: function(params) {
    var result = '';
    // Build the query string 
    return result;
  }
});

 

或者全局设置

var instance = axios.create({ paramsSerializer: function(params) { /* ... */ } })

 

axios.defaults.paramsSerializer = function(params) { /* ... */ };

 

或者把key直接加在url上

 

axios.get('https://foobar.com/api?api_key=' + key);

 

axios.get('https://foobar.com/api?api_key=' + key, {
  params: {
    foo: 'bar'
  }
});

 

相关文章:

  • 2021-12-17
  • 2022-12-23
  • 2021-06-06
  • 2022-12-23
  • 2021-04-02
  • 2021-05-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 1970-01-01
  • 2022-12-23
  • 2022-12-23
  • 2021-08-04
相关资源
相似解决方案