【发布时间】:2016-07-07 03:45:04
【问题描述】:
我是 Angular 2 的新手,我的应用程序在 IE 和 chrome 上运行良好。但是,当我在 Firefox 中尝试时,调用我的 PHP 脚本的发布请求在 Firefox 中不起作用。
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)
}
【问题讨论】:
-
拜托,更准确,发布你得到的错误
-
不清楚问题但可以检查参考stackoverflow.com/a/37290319/5868331
标签: javascript php firefox angular