get请求与post请求方式

Post

 $http
        .post("http://47.244.175.166:8086/api/System/AddApi",{
    
    
            ActionName: this.form.ActionName,
            Controller: this.form.Controller,
            Action: this.form.Action,
            Parameters: this.form.Parameters,
            RequestType: this.form.RequestType,
            Memo: this.form.Memo
        },{
    
    
          headers:{
    
    
            token:this.token
          }
        })
        .then(res => {
    
    
          console.log(res)
        })

Git

$http
        .get("http://47.244.175.166:8086/api/System/GetApis", {
    
    
          params: {
    
    
            controllername: this.jiss.input1,
            action: this.jiss.input2,
            pageNum: val, //当前页码
            numPerPage: 2, //分页条数
            orderField: "",
            orderDirection: ""
          },
          headers: {
    
     Token: this.token } //设置header信息
        })
        .then(res => {
    
    
          this.tableData = JSON.parse(res.data).Data.Apis;
          console.log(res)
        });

猜你喜欢

转载自blog.csdn.net/qq_44977477/article/details/103462013