Symfony2 JSON POST Data – Apache application/json

We are actually developing an Anrdoid Applicaton using a Symfony2 Backend for Webservice Activities. In local DEV Enviroment we have tested the Webservices successful.

Now in Test Enviroment the given Post Data is not avalible on server side. We have checked different test szenarios with different PHP Versions/ PHP Extensions and PECL Packages without any helpful results. Is there any PHP Extension doing a conversion of JSON Post Data to a set of variables or have you got other helpful hints to solve this problems?

Many Thanks


Local Development Enviroment in usage of PHP Integrated Webserver (on MacOSX)

Request:

curl .../app_dev.php/authenticate -d '{"username":"user@server.de", "password":"test"}' 
--header "Content-Type: application/json"

Return: 

var_dump($_POST)

array(2) {
  ["username"]=>
  string(13) "user@test.de"
  ["password"]=>
  string(4) "test" 
}

Versions:

PHP 5.6.8

Remote Server in usage of Apache Webserver (on Ubuntu 14.04)

Request:

curl .../app_dev.php/authenticate -d '{"username":"user@server.de", "password":"test"}' 
--header "Content-Type: application/json"

Return: 

var_dump($_POST)

array(0) {
}

Versions:

PHP 5.5.9-1ubuntu4.9
Apache/2.4.7

Remote Server in usage of PHP Integrated Webserver (on Ubuntu 14.04)

Request:

curl .../app_dev.php/authenticate -d '{"username":"user@server.de", "password":"test"}' 
--header "Content-Type: application/json"

Return: 

var_dump($_POST)

array(0) {
}

Versions:

PHP 5.5.9-1ubuntu4.9


Source: apache

Leave a Reply