【发布时间】:2018-03-14 11:45:21
【问题描述】:
当我使用 Postman 发起 GET 请求时,我收到 200 响应,所以我不明白为什么该请求没有在我的数据库中注册,当我使用 GET 请求访问我的网站时,它可以正常工作,但不能邮递员。
示例:
https://i.gyazo.com/24e66cedfa2dbb3e7ca388c73d89fe73.png
可能是因为标题内容?
addDonneesEau(id: number, voltage, niveau_eau, vitesse, datetime, date, heure): Observable<DonneesEauModel> {
const body = { voltage, niveau_eau, vitesse, datetime, date, heure };
console.log(body);
return this.httpClient.post<DonneesEauModel>(`${environment.baseUrl}/capteurs-eaus/${id}/donnees-eaus`, body);
}
addValeurEau() {
this.receptionService.addDonneesEau(
this.capteurId,
this.Voltage,
this.niveau_eau,
this.vitesse,
this.datetime,
this.date,
this.heure,
).subscribe(
() => this.registrationFailed = true,
);
}
该应用是使用 Angular 5 和 Symfony 3 开发的。
【问题讨论】:
标签: angular symfony get postman