Hallo,
Ich versuche, folgenden simplen Code auf Tomcat unter Windows mit XAMPP aufzurufen. Dafür benutze ich als Client Postman und schicke einen POST request.
http://localhost/dbj/backend/registe...di&price=50000
Die Funktion/Zeile
liefrt jedoch immer empty - was ist da falsch?
Ich versuche, folgenden simplen Code auf Tomcat unter Windows mit XAMPP aufzurufen. Dafür benutze ich als Client Postman und schicke einen POST request.
http://localhost/dbj/backend/registe...di&price=50000
Die Funktion/Zeile
PHP-Code:
$postdata = file_get_contents("php://input");
PHP-Code:
<?php
// Get the posted data.
$postdata = file_get_contents("php://input");
if (isset($postdata))
{
echo "data was NOT null (ok)"; // test passed
if (!empty($postdata))
{
echo "data filled"; // test NOT passed
}
else
{
echo "data NOT filled (nok)"; // ... but variable is empty from file_get_contents
}
}
else
{
echo "data null";
}
Kommentar