📜  axios.post 标头示例 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:03:21.093000             🧑  作者: Mango

代码示例3
const headers = {
  'Content-Type': 'application/json',
  'Authorization': 'JWT fefege...'
}

axios.post(Helper.getUserAPI(), data, {
    headers: headers
  })
  .then((response) => {
    dispatch({
      type: FOUND_USER,
      data: response.data[0]
    })
  })
  .catch((error) => {
    dispatch({
      type: ERROR_FINDING_USER
    })
  })