動態

詳情 返回 返回

[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

user avatar yinzhixiaxue 頭像 hard_heart_603dd717240e2 頭像 shuirong1997 頭像 nznznz 頭像 b_a_r_a_n 頭像 gkymfrg1 頭像 codesheep_pro 頭像 columsys 頭像 zz_641473ad470bc 頭像 lewyon 頭像 ddup365 頭像 zhaoxiaoman 頭像
點贊 24 用戶, 點贊了這篇動態!
點贊

Add a new 評論

Some HTML is okay.