今天使用post方法向后端请求数据,始终不成功,最后在方法请求头中加上 ‘Content-Type’: ‘application/json;charset=UTF-8’,请求成功

 async bpaParams() {
      const res = await this.$http.post(
        '/acline/datbpagenerate',
        JSON.stringify(data),
        {
          headers: {
            'Content-Type': 'application/json;charset=UTF-8',
          },
        }
      )
      console.log(res)
    },

更多推荐

vue项目post请求中携带‘Content-Type‘: ‘application/json;charset=UTF-8‘