代码之家  ›  专栏  ›  技术社区  ›  PuntanetDeveloper

错误400错误请求5使用令牌登录

  •  0
  • PuntanetDeveloper  · 技术社区  · 7 年前

    我的服务是:

     getToken(){
        var data = "grant_type=password&username=" + "username" + "&password=" + "yTX7W0s1zYxbJJT3+pXtJA==";
    
    return this.http.post<any>('http://localhost:51643/token', data).pipe(map(res =>res))
    }
    

    在我的心情里

    constructor(private data: PostaserviceService) { }
      ngOnInit() {  
         this.data.getToken().pipe().subscribe(res => {
          console.log(res);
        });
    }
    

    我有一个错误: http://localhost:51643/token 400(错误请求) ERROR HttpErrorResponse{头:HttpHeaders,状态:400,状态文本:“错误请求”,url:“ http://localhost:51643/令牌 “,确定:错误,}

    1 回复  |  直到 7 年前
        1
  •  1
  •   PuntanetDeveloper    7 年前

    我解决的问题是我不能通过特殊字符==

    推荐文章