Quantcast
Channel: Active questions tagged rest - Stack Overflow
Viewing all articles
Browse latest Browse all 3733

How to read json data from HttpURLConnection

$
0
0

I am using HttpURLConnection from application1 to get json data from applicaton2. 'applicaton2' sets json data in Rest response object. How can i read that json data after getting response in application1.

Sample code:

Application1:

url = "url to application2";urlConnection = (HttpURLConnection) url.openConnection();urlConnection.connect();

Application2":

List<ModelA> lListModelAs = Entities data;GenericEntity<List<ModelA>> lEntities = new GenericEntity<List<ModelA>>(lListModelAs) {};lResponse = Response.ok(lEntities ).build();

I need to read above json data from urlConnection from response.

Any hints? Thanks in advance.


Viewing all articles
Browse latest Browse all 3733

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>