我正在测试需要欺骗IP和手机号码才能进行测试的流程。问题是 CURLOPT_HTTPHEADER 。链接无法访问我发送的标头值。下面是我的代码。
public serviceMethod(){
this.http.get(urlThatWillRedirect).catch(this.handleError).subscribe(data =>...);
}
private handleError(error:any){
if(error.code == 302 || error.code == 401){
// clear your user credentials here like localStorage,Auth token etc..
window.location.href = '/#/error';
return Observable.throw(error.json());
}
}
任何想法都需要更改。谢谢