1

I'm making a service call from Angular 7.

   search(params) {

   let url = 'https://thisapp.com/api/search.php';
   return this.http.post(url, params);

   }

console.log of 'params'

  {keywords: "riches", recent: "false", magic: ["fun"] }

The 'params' are not being read into the $_POST variable in my script on the live server. In Postman or my local dev environment, they do show up correctly.

<?php 

    var_dump($_POST); exit;
    --- the rest of the code ---

?>

In Postman:

array(3) {
["keywords"]=>string(6) "riches"
["recent"]=>string(5) "false"
["magic"]=>array(1) {
[0]=>string(3) "fun"
}
}

Live server:

array(0)

So it is not receiving the data as a $_POST array. I'm thinking it's something with headers...

The Hawk
  • 1,496
  • 6
  • 26
  • 43

0 Answers0