I use this code to make requests to a server, it usually works fine but sometimes it throws some errors since its under development, however if it throws an error volley tries to parse it into a JsonObject and will inevitably fail.
final JsonObjectRequest jsonObjectRequest = new JsonObjectRequest
(Request.Method.POST, baseUrl, postparams, new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
Log.w("Response", response.toString());
callBackActivity.JsonCallback(response, "grupos");
}
}, new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
callBackActivity.ErrorCallback(error, "grupos");
}
});
So is there any way to know whats the raw response of the server before parsing it into a JsonObject?