2016-07-06 45 views
1

我是Angular 2的新手,我的应用程序可以在IE和Chrome中正常工作。但是,当我尝试使用Firefox时,调用我的PHP脚本的发布请求在Firefox中不起作用。Angular 2与Firefox的POST

postApplicant(newApplicant: Applicant): Observable<string> { 
     let body = `firstName=${newApplicant.firstName}&lastName=${newApplicant.lastName}`; 
     let headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' }); 
      headers.append('Accept', 'q=0.8;application/json;q=0.9'); 
     let options = new RequestOptions({ headers: headers }); 

     return this.http.post(this.emailUrl, body, options) 
         .map(res => <string> res.json()) 
         .catch(this.handleError) 
} 
+0

请,更准确,发布你得到的错误 – 0x13a

+0

不清楚问题,但可以检查参考http://stackoverflow.com/a/372​​90319/5868331 – mayur

回答