【发布时间】:2018-06-27 03:31:46
【问题描述】:
这是我的提供程序代码,其中我在标头中传递多个数据
postEventComment(body,headers){
return this.http.post(this.api_comment_event, body,{ headers: {'Content-Type' :'multipart/form-data','userId':'1451'} })
.do((res: Response) => console.log(res))
// .map((res: Response) => res.json())
.catch(this.catchError)
}
这是我的评论ts代码
this.body2 = 'eventId' + '=' + id + '&comment=' + this.body.comment
let headers = new Headers();
let body = this.body
this.api_list.postEventComment(this.body2,headers).subscribe(data => {
console.log(data);});
下面是我的截图
【问题讨论】:
-
this.http的类型是什么?请提供您的问题的最低限度的复制品
标签: angular typescript ionic3