So I am making a POST JSonObjectRequest to my server and when it is successful everything works and the info is posted, but if there is an error and I try to display it in a
The VolleyError object has a networkResponse reference, try to check it to see if you can get some useful information from there.
@Override
public void onErrorResponse(VolleyError error) {
if (error == null || error.networkResponse == null) {
return;
}
String body;
//get status code here
final String statusCode = String.valueOf(error.networkResponse.statusCode);
//get response body and parse with appropriate encoding
try {
body = new String(error.networkResponse.data,"UTF-8");
} catch (UnsupportedEncodingException e) {
// exception
}
//do stuff with the body...
}