Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- byte[] bytes = "username:password".getBytes("UTF-8");
- String encoded = Base64.encodeBase64String(bytes);
- URL api = new URL("https://api.pinnaclesports.com/v1/feed?sportid=29");
- URLConnection apiConnection = api.openConnection();
- apiConnection.addRequestProperty("Authorization", "Basic " + encoded);
- BufferedReader in = new BufferedReader(new InputStreamReader(apiConnection.getInputStream()));
- String inputLine;
- while ((inputLine = in.readLine()) != null)
- System.out.println(inputLine);
- in.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement