CustomStringRequest customStringRequest = new CustomStringRequest(requestMethod.ordinal(), serverUrl,
result -> {
Log.d(TAG, "headers: " + result.headers);
Log.d(TAG, "response: " + result.response);
createTaskItem(result);
},
error -> {
Log.d(TAG, "error: " + error);
})
error is in JSON
string, I tried to get error like this:
new String(error.networkResponse.data, "utf-8");
new String(error.networkResponse.data);
none of the above method works, i always get empty string, don't know why :(
as you can see bytes in picture, the error response is actually this:
{
"error": [
"Wrong Credentials!"
],
"email_exists": false
}
I am using:
implementation 'com.android.volley:volley:1.1.1'