I am working with Volley, I want to make request to a server which returns me a JSON in the "vissible layer" (I can see it in the web browser). My problem is that the server also returns my in the headers information that I need to get in my App, but I am not able to get the headers from the request.
I have searched a long time but I havent found anything usefull (Onlye adding data to the request Header, but not getting data from the header´s response)
Anyone knows how to implement that?
If the request is returning
json
you should be able to read it normally, if not the problem is from thejson
not from the Android App.Here is an example of request handling:
This is an example to work with JSONArray data and headers.
First create your own custom request type implementation:
and in your request code:
See more information about implementing your own custom request in the Volley documentation Implementing a Custom Request.
To get the headers you need to override
parseNetworkResponse()
in your request.for example the
JsonObjectRequest
: