Advertisement
Guest User

Untitled

a guest
Feb 27th, 2020
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.96 KB | None | 0 0
  1. /*
  2.  * This Java source file was generated by the Gradle 'init' task.
  3.  */
  4. package testcurl;
  5.  
  6. import org.apache.http.HttpResponse;
  7. import org.apache.http.client.HttpClient;
  8. import org.apache.http.client.methods.HttpGet;
  9. import org.apache.http.impl.client.DefaultHttpClient;
  10.  
  11. import java.io.BufferedReader;
  12. import java.io.IOException;
  13. import java.io.InputStreamReader;
  14.  
  15. public class App {
  16.  
  17.     public static void main(String[] args) throws IOException {
  18.         HttpClient client = new DefaultHttpClient();
  19.         HttpGet request = new HttpGet("https://www.congstar.de/api/data/location-storage/contexts/aufladefinder");
  20.         HttpResponse response = client.execute(request);
  21.         BufferedReader rd = new BufferedReader
  22.                 (new InputStreamReader(
  23.                         response.getEntity().getContent()));
  24.  
  25.         String line = "";
  26.         while ((line = rd.readLine()) != null) {
  27.             System.out.println(line);
  28.         }
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement