[axios] axios中post请求的发送

接上文[《[axios] axios中get请求的发送》](https://segmentfault.com/a/1190000043982778)

针对post请求,建议下面这两种
1、axios(config) (建议使用)
举例:

axios({
  method: 'post',
  url: '/fund/info',
  data: {
    fundId: "000001",
    type: "bond"
  }
});

2、axios.post(url[, data[, config]])
举例:

axios.post('/fund/info', 
  {
    fundId: "000001",
    type: "bond"
  },
  {
    headers: {
      "Content-Type": "application/json"
    }
      timeout: 8000
  }
);

同步更新到自己的语雀
https://www.yuque.com/dirackeeko/blog/fnow4fot1epk5snc

你可能感兴趣的:([axios] axios中post请求的发送)