$_POST in php not populated using Volley library JsonObjectRequest (method POST) $_POST in php not populated using Volley library JsonObjectRequest (method POST) json json

$_POST in php not populated using Volley library JsonObjectRequest (method POST)


1.) Pass your json object instead of string

JsonObjectRequest jsonReq = new JsonObjectRequest(JsonRequest.Method.POST,                url_cond1, jason ,               //          ^^^^                new Response.Listener<JSONObject>() {

2.) Receive it in your php as

<?php    $response   = array();    // receive your json object    $jasonarray = json_decode(file_get_contents('php://input'),true);    $response["Condicao"] = $jasonarray["Condicao"];    $response["Field"]    = $jasonarray["Field"];    $response['sucess']   = 1;    $response['other']    = "test";    echo json_encode($response);?>