1
Angular:
public urlConvenio: string = "http://localhost/teste/sistema/backend/controller/convenio/listar.php";
const httpOptions = {
headers: new HttpHeaders({
'Content-Type': 'application/json'
})
};
//REQUISIÇÃO
public enviaDados() {
this.http.post(this.urlPost,
JSON.stringify(this.myForm.value),
this.httpOptions).subscribe(res => {
console.log(res);
})
}
Error:
Server:
I think you don’t need the stringify, the angular already made it for you as a pattern.
– Eduardo Vargas