尝试覆盖标头的内容类型,但仍以text/plain格式显示。有一种方法可以与Ben Nadel的GateWayAPI配合使用,但希望有一种不涉及自定义包装的解决方案。Angular2 ES5 - 在HTTP POST报头中覆盖内容类型
var url = this.url;
var body = JSON.stringify({email_login: "login", password_login: "password"});
var headers = new Headers({ 'Content-Type': 'application/x-www-form-urlencoded' });
return this.http.post(url, body, {headers:headers})
.map(function (response) {
return response.json();
})
.catch(this.handleError);
我也尝试过,没有运气。 – kaotik