I am newbie to Json parsing. I am trying to read a json data using JsonArrayRequest but I am little confused in sending parameters and use POST method.In case o
Here you go..
final HashMap params = new HashMap();
params.put("email", userName);
params.put("password", password);
final JSONObject jsonObject = new JSONObject(params);
JsonArrayRequest req = new JsonArrayRequest(Request.Method.POST, url, jsonObject,
new Response.Listener() {
@Override
public void onResponse(JSONArray response) {
try {
//process response
}
catch(JSONEXception e){}
And on PHP side you can get these params like this
$json=file_get_contents('php://input');
$data = json_decode($json);
$email=$data->{'email'};
$pass=$data->{'password'};