【发布时间】:2018-07-16 22:18:02
【问题描述】:
我正在尝试使用表单数据元素(这是 api 支持的)发布帖子,但是当使用 .post 时,它会发送请求有效负载。
如果我将标头设置为"Content-Type": "application/x-www-form-urlencoded",那么它将整个 json 作为具有空白值的键发送
我在这里做错了什么?
this.http.post("/auth", {
uaUserName: this.loginForm.controls.uaUserName.value,
uaPassword: this.loginForm.controls.uaPassword.value
})
.subscribe((data: Profile) => {
this.profileProvider.profile = {...data};
},
() => {
}
);
示例帖子:
【问题讨论】:
标签: angular http rxjs httpclient