【发布时间】:2018-03-29 22:15:33
【问题描述】:
reg.ts
var data = JSON.stringify({
"name": {
"value": this.registerForm.value.email
},
"mail": {
"value": this.registerForm.value.email
},
"pass": {
"value": this.registerForm.value.password
},
"field_user_type": {
"value": 'normal' // | venue|celebrity|event_management//this.userType
}
});
let header=new Headers({'Content-Type': 'application/json'});
header.append("cache-control", "no-cache");
this.http.post('..................../user/register?
_format=json',data, {headers: header}).
subscribe(res=>{
this.output=res.json()
if(this.output) {
this.navCtrl.setRoot(AgreementPage)
}
},
err=>{
console.log(err)
})
我可以使用邮递员发送帖子,并成功获得响应,但是当我发出如上所示的帖子请求时收到错误消息
“X-CSRF-Token 请求头丢失”
【问题讨论】:
-
可以分享后端代码和使用的技术吗?