How to parse 401 response data for volley,here is the server response am getting i haev used volley network response but its not able to get response data which is in JSON format
Status 200 OK
{
alert: {
title: "Unauthorised access to appointment"
message: ""
}-
response: "0"
}
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Log.e(TAG, "Req Failed!");
mProgressDialog.dismiss();
NetworkResponse localNetworkResponse = error.networkResponse;
if (localNetworkResponse != null) {
if (!WebAPIEngine.checkStatusCodeVolley(localNetworkResponse.statusCode)) {
AlertDialogUtil.displayErrorAlert(error.toString(), mContext);
}
} else {
Log.e(TAG, error.toString());
try {
JSONObject jsonObject = new JSONObject(error.getMessage());
if (WebAPIEngine.processErrorAlertResp(jsonObject)) {
AlertDialogUtil.displayErrorAlert(WebAPIEngine.getErrorMessage(), mContext);
} else {
AlertDialogUtil.displayErrorAlert(error.toString(), mContext);
}
}
catch (Exception e) { e.printStackTrace(); }
}
}
});