解决Vue中POST提交后变成GET请求

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/LaySwift/article/details/82496681

需要在header中添加Content-Type字段,Tornado后台获取用get_argument()方法。

    this.$axios({
        headers: {
            'Content-Type': 'application/x-www-form-urlencoded;charset=utf-8',
            "Authorization": 'Bearer ' + this.authorization,
                    },
            method:'get',
            url:this.ip + '/algorithms/'+this.currentId+"/version/"+verId ,
                }).then((res) =>{
                    console.log(res)
                    let data = res.data.data
                    // self.historyData = data
                    self.historyData.create_time = data.create_time
                    self.historyData.algo_content= data.algo_content
                    self.isHistory = true
                    this.currentVersionId = verId
                    self.addNumberLine()
                }).catch(function(err){
                        console.log(err)
                })

猜你喜欢

转载自blog.csdn.net/LaySwift/article/details/82496681
今日推荐