美文网首页
新版Clever前端请求接口格式

新版Clever前端请求接口格式

作者: 环零弦 | 来源:发表于2018-06-23 19:39 被阅读0次
    private httpDemo() {
      const incrementParams: IncrementParams = {
        route: '/login/test22222',
        uid: '6',
        orderBy: [{
          colIndex: 1,
          orderType: 'DESC'
        }, {
          colIndex: 2,
          orderType: 'ASC'
        }]
      };
      const reqStructure: RequsetStructure = {
        reqParams: {
          name: 'randy',
          number: '123456'
        },
        withCredentials: true
      };
      const reqStructure2: RequsetStructure = {
        reqParams: {
          name: 'vivian',
          number: 'qwerasdf'
        },
        withCredentials: true
      };
      // const submitUrl = 'https://www.sojson.com/open/api/weather/json.shtml?city=长春';
      this.submitService.getHttpSubmit('/req-template/test1111', true, reqStructure)
        .subscribe(data => alert(JSON.stringify(data)), error => {
          console.log(error)
        });
      this.submitService.postHttpSubmit('/req-template/test1111', true, reqStructure2)
        .subscribe(data => alert(JSON.stringify(data)), error => {
          console.log(error)
        });
      this.submitService.getHttpSubmit('/req-template/test2222', true, reqStructure, incrementParams)
        .subscribe(data => alert(JSON.stringify(data)), error => {
          console.log(error)
        });
      this.submitService.postHttpSubmit('/req-template/test2222', true, reqStructure2, incrementParams)
        .subscribe(data => alert(JSON.stringify(data)), error => {
          console.log(error)
        });
    }
    

    相关文章

      网友评论

          本文标题:新版Clever前端请求接口格式

          本文链接:https://www.haomeiwen.com/subject/eysdyftx.html