Stories

Detail Return Return

[axios] axios中post請求的發送 - Stories Detail

接上文[《[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 Avatar hard_heart_603dd717240e2 Avatar shuirong1997 Avatar nznznz Avatar b_a_r_a_n Avatar gkymfrg1 Avatar codesheep_pro Avatar columsys Avatar zz_641473ad470bc Avatar lewyon Avatar ddup365 Avatar zhaoxiaoman Avatar
Favorites 24 users favorite the story!
Favorites

Add a new Comments

Some HTML is okay.