【问题标题】:Angular 5 http.post Authorization header is not setAngular 5 http.post 授权标头未设置
【发布时间】:2019-01-29 20:42:23
【问题描述】:
const httpOptions = {
          headers: new HttpHeaders({
            'Content-Type':  'application/x-www-form-urlencoded',
            'Authorization': 'Basic d2ViYXBwOjExMTE=',
            'Access-Control-Expose-Headers' : 'Authorization',
            'Accept' : 'application/json'
          })
        };
    return this.http.post(oauth2_token_endpoint, {}, httpOptions);

Http请求的截图是:

请帮忙。

【问题讨论】:

标签: spring-boot spring-security oauth-2.0 angular5 spring-security-oauth2


【解决方案1】:
const httpOptions = {
    headers: new HttpHeaders({ 'Content-Type': 'application/json' })
  };

【讨论】:

  • 从 '@angular/common/http' 导入 { HttpClient,HttpHeaders };
猜你喜欢
  • 1970-01-01
  • 2016-07-13
  • 2018-08-28
  • 2021-11-21
  • 1970-01-01
  • 1970-01-01
  • 2015-11-05
  • 2023-04-09
  • 1970-01-01
相关资源
最近更新 更多