I have an application that consumes data from a network server, it follows my code:
conn.setRequestMethod("GET");
conn.setRequestProperty("Authorization", "Basic " + asB64);
conn.setRequestProperty("Accept", "application/json");
conn.setRequestProperty("Access-Control-Allow-Origin", "*");
if (conn.getResponseCode() != 200) {
throw new RuntimeException("Failed : HTTP Error code : "
+ conn.getResponseCode());
}
InputStreamReader in = new InputStreamReader(conn.getInputStream());
BufferedReader br = new BufferedReader(in);
I have already created the object with the data and I am able to manage it. The problem is that I needed this application to run in real time in order to save the data as it was consumed in the database.