在http的post中
1 2 3 |
login(email: string, password: string) { return this.http.post(`http://10.0.1.19/api/login`, { email, password }) } |
你会发现chrome爆出一个错误:
Http failure during parsing for http://10.0.1.19/api/login
解决办法:
修改responseType
1 2 3 4 |
return this.http.post( 'http://10.0.1.19/api/login', {email, password}, {responseType: 'text'}) |
或者更改服务器端输出的内容格式。