Advertisement
Guest User

Untitled

a guest
Dec 20th, 2014
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.58 KB | None | 0 0
  1.  byte[] bytes = "username:password".getBytes("UTF-8");
  2.         String encoded = Base64.encodeBase64String(bytes);
  3.  
  4.         URL api = new URL("https://api.pinnaclesports.com/v1/feed?sportid=29");
  5.         URLConnection apiConnection = api.openConnection();
  6.         apiConnection.addRequestProperty("Authorization", "Basic " +   encoded);
  7.         BufferedReader in = new BufferedReader(new InputStreamReader(apiConnection.getInputStream()));
  8.         String inputLine;
  9.  
  10.         while ((inputLine = in.readLine()) != null)
  11.             System.out.println(inputLine);
  12.         in.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement