How send method POST with JSON? Arduino UNO R3 + SIM900 Why is the server side of php not loading any data from arduino? What did I do wrong?

  String reading="{\"latitude\": 12.983027,  \"longitude\": 80.2594}";
  mySerial.println("AT+HTTPINIT"); 
  toSerial(1000);

  mySerial.println("AT+HTTPPARA=\"CID\",1"); 
  toSerial(1000);

  mySerial.println("AT+HTTPPARA=\"URL\",\"http://gerro.usermd.net/updateData.php\"");
  toSerial(1000);

  mySerial.println("AT+HTTPPARA=\"CONTENT\", \"application/json\"");
  toSerial(1000);

  mySerial.println("AT+HTTPDATA=" + String(reading.length()) + ",100000");
  toSerial(5000);

  mySerial.println(reading);
  toSerial(1000);

  mySerial.println("AT+HTTPACTION=1"); 
  toSerial(15000);

  mySerial.println("AT+HTTPREAD"); 
  toSerial(1000);

  mySerial.println("AT+HTTPTERM"); 
  toSerial(500);


Result:

AT+HTTPINIT

OK
AT+HTTPPARA="CID",1

OK
AT+HTTPPARA="URL","http://gerro.usermd.net/updateData.php"

OAT+HTTPPARA="CONTENT", "application/json"

OK
AT+HTTPDATA=46,100000

DOWNLOAD

OK
AT+HTTPACTION=1

OK

+HTTPACTION:1,200,55
AT+HTTPREAD

+HTTPREAD:55
array(0) {
}
array(0) {
}
nic ciekAT+HTTPTERM

OK


EDITING 

void toSerial(int delay_ms)
  {
    delay(delay_ms);

    while(mySerial.available()) 
    {
       Serial.write(mySerial.read());
    }
  }


PHP

&lt;?php
var_dump($_POST);
if (isset($_POST['latitude']) &amp;&amp; isset($_POST['longitude']) &amp;&amp; $_SERVER['REQUEST_METHOD'] === 'POST') {
//code
} else {
echo 'nic';
}
You had to change the php file:

var_dump($_POST);


to:

echo print_r(json_decode(file_get_contents("php://input")));


Thank you !