For a school projecht we want to read data from the data pins and send them to a php aplication. We get the data and can make a json string from it, but when we try to send the data (multidimensional) the $_POST var is empty of the php script (it returns the $_POST var).
Do we something wrong? we can not find a working example.
Thanks.
Sending part:
Serial.println("versturen...");
String postData = "{\"naam\":\"ik\"}";
/*apiconnectie.beginRequest();
apiconnectie.post(path);
//apiconnectie.sendHeader("Content-Type", "application/x-www-form-urlencoded");
apiconnectie.sendHeader("Content-Type", "application/json");
apiconnectie.sendHeader("Content-Length", postData.length());
apiconnectie.beginBody();
apiconnectie.print(postData);
apiconnectie.endRequest(); */
apiconnectie.beginRequest();
apiconnectie.post(path);
apiconnectie.print("Content-Length: ");
apiconnectie.println(postData.length());
apiconnectie.println();
apiconnectie.println(postData);
statusCode = apiconnectie.responseStatusCode();
response = apiconnectie.responseBody();
Serial.println("Status code: ");
Serial.println(statusCode);
Serial.println("Response: ");
Serial.println(response);