动态

详情 返回 返回

[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.