url = "http://httpbin.org/post";
StringRequest postRequest = new StringRequest(Request.Method.POST, url,
new Response.Listener<String>()
{
@Override
public void onResponse(String response) {
// response
Log.d("Response", response);
}
},
new Response.ErrorListener()
{
@Override
public void onErrorResponse(VolleyError error) {
// error
Log.d("Error.Response", response);
}
}
) {
@Override
protected Map<String, String> getParams()
{
Map<String, String> params = new HashMap<String, String>();
params.put("json", "{\"0\":\"valor1\",\"1\":\"valor2\",\"2\":\"valor3\",\"3\":\"valor4\"}");
params.put("json2", (new JSONObject("{\"0\":\"valor1\",\"1\":\"valor2\",\"2\":\"valor3\",\"3\":\"valor4\"}")).toString());
return params;
}
};
Try that and convert it to an array in the web service that I imagine you have control over; what I mean in the post parameter "json2" is that you could also create a json in the java santaxis and convert to a string