Created
July 27, 2015 17:34
-
-
Save sunieldalal/53685063b5631a0fbc28 to your computer and use it in GitHub Desktop.
Base64 username/pasword example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //Reference: http://ostermiller.org/utils/Base64.html | |
| URL url = new URL("http://...."); | |
| HttpURLConnection connection = (HttpURLConnection)url.openConnection(); | |
| connection.setRequestProperty( | |
| "Authorization", | |
| "Basic " + Base64.encode( | |
| username + ":" + password | |
| ) | |
| ); | |
| InputStream in = connection.getInputStream(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment