I have a bit nonstandard situation where server sends in case of error responses (500, 404, ..) also json Object inside of response. But I have a problem to get it in Volley. Is there any way how to parse it from headers ?
Asked
Active
Viewed 330 times
0
-
@maxxxo check this http://stackoverflow.com/q/26015610/1168654 – Dhaval Parmar Jul 08 '16 at 09:01
2 Answers
0
Simple solution is to override parseNetworkResponse
in makeStringReq()

Dhaval Parmar
- 18,812
- 8
- 82
- 177

Mattia
- 124
- 8
0
HTTP error codes should not have data in the returned response
you can as suggested before, extend Volley's
Request
and override theparseNetworkResponse
and pass on the data if needed or do anything that is reqired.
p.s. remember that it runs off the UI thread but is blocking a network thread, so you can do heavy parsing but should probably only figure out if this is a success or error and let the rest of the chain take care of parsing.You can also write your own
ErrorListener
and figure out what to do upon the different types of errors reponses

thepoosh
- 12,497
- 15
- 73
- 132