【发布时间】:2020-05-05 13:32:35
【问题描述】:
角度 http 调用:
login(){
const loginstring = 'https://<removed>.auth0.com/authorize?' +
'response_type=token&' +
'client_id=<removed>&' +
'connection=null&' +
'redirect_uri=<removed>';
this.http.get(loginstring, {observe: 'response'}).subscribe(
(req:any)=>{
console.log('this is the http response');
console.log(req);
});
}
回复
不使用代码格式化,因为没有它更容易阅读。
错误 HttpErrorResponse {headers: HttpHeaders, status: 200, statusText: "OK", url: "http://localhost:4200/", ok: false, ...}headers: HttpHeaders {normalizedNames: Map(0),lazyUpdate: null,lazyInit :ƒ}状态:200statusText:“OK”url:“http://localhost:4200/”ok:falsename:“HttpErrorResponse”消息:“解析http://localhost:4200/时Http失败”错误:{错误:SyntaxError:意外的令牌proto:HttpResponseBase
httpclient 默认返回响应的 json,这是我正在积极研究的。但我不确定如何解决这个问题。
【问题讨论】:
标签: angular authentication error-handling auth0 angular-httpclient