I've hit a roadblock with a straightforward problem, and despite my best efforts, I haven't been able to find a solution online. Here's the code that I'm struggling with:
const URL = 'http://(...)/scripts/Fiabilisation_Unique.php';
const httpOptions = {
headers: new HttpHeaders({
'Content-Type: application/json'
'reportProgress': 'true'
})
(...)
onClickAdresse(f : NgForm){
var adresse : Adresse= (f.value);
console.log(adresse); //{adresse : "just a french adresse"}
this.http.post(URL, adresse, httpOptions).subscribe(
(event) => {
this.temp=(event); // handle event here
},
() => {
console.log("Observable done ! ");
}
);
}
But when I check in my 'Fiabilisation_Unique.php' file with a simple print_r($_POST);
, it gives me an empty array: Array(
)
I have a feeling that the problem isn't too complex, but for the life of me, I can't pinpoint what's wrong. I know the answer is probably just around the corner, but...
Thank you in advance :)