【问题标题】:How to send Multiple ID's in restful api endpoint如何在restful api端点中发送多个ID
【发布时间】:2018-09-23 11:15:29
【问题描述】:

端点格式为http://localhost:8080/api/user/name/id/uid

和

this.http.get('/api/user/' + this.authService.name + this.authService.sid+ this.authService.userid  )
      .subscribe(result => {
        console.log('get ====>' + JSON.stringify(result));
      });

【问题讨论】:

  • 你试过输出'/api/user/' + this.authService.name + this.authService.sid+ this.authService.userid吗?为什么不呢?

标签: typescript angular5 restful-authentication


【解决方案1】:

只需放置 + '/' + 它将给出端点格式

this.http.get('/api/user/' + this.authService.namespace + '/' + this.authService.userid + '/' + this.authService.sid )

【讨论】:

    猜你喜欢
    • 2014-01-10
    • 1970-01-01
    • 1970-01-01
    • 2014-12-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多