HTTP POST data should be present in $_POST
. You should first check that this superglobal contains any data. If not, data are not being correctly POSTed to your URL.
You are right to test by having data emailed to yourself, however this can be problematic with non-string types. You need to be certain that $feedData
is a string and contains data.
Examining the type and content of a variable is straightforward when combining var_dump() with output buffering. Try:
ob_start();
var_dump($_POST);
$testDump = ob_get_contents();
ob_end_clean();
mail('[email protected]', 'data feed from vendor', $testDump);
Testing process:
POST anything to your URL and check that the resulting email contains the correct data.
If the resulting email is not as you expect, the fault lies with your code. Work with the code until the test email contains what you expect given the data you POST.
Ask the vendor to POST their data
Examine the resulting email and see if it matches what you expect. If not, check with the vendor as to the nature of the data they are sending - perhaps your understanding or expectations are wrong. Repeat until you get the correct content in the test email.
From examining the content of the test email, you can determine the elements within $_POST that are relevant to your needs, extract them as necessary and continue development.
At the point when your test email does contain what you expect, note the $_POST contents such that you can construct an identical POST request which you can use when continuing development.