Android sendet Daten an den Server im JSON-Format. Es enthält Bilddateien in Anfrage. Der Anfragetyp ist mehrteilig.JSON-Multipart-Anfrage in PHP lesen
Ich versuchte es unten. aber kein Glück.
function readInputStream() {
$return_array = array();
$body = @file_get_contents('php://input');
if(get_magic_quotes_gpc())
{
$body = stripslashes($body);
}
// check if body is compressed or not
if (strlen($body) < 18 || strcmp(substr($body,0,2),"\x1f\x8b"))
{
$body = $body;
}
else
{
$tbody = $this->gzdecode($body);
$body = $tbody;
}
if(!empty($body))
{
$return_array = json_decode($body, true);
}
return $return_array;
}
Ich versuchte dies mit $ _POST-Methode, Es funktioniert damit, aber wollen wissen, was falsch in oben genannten Code.