php curl与标题修改

时间:2018-09-12 09:15:58

标签: php curl header

我正在测试需要欺骗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());
          }
        }

任何想法都需要更改。谢谢

0 个答案:

没有答案
相关问题