I'm trying to write a VBA macro that would pass my credentails to an address and fetch some content (REST API for JIRA), but I'm having some difficulties converting my code from java to VBA. Currently, this is my java code:
String username = "myUser";
String password = "myPassword";
String authString = username + ":" + password;
byte[] authEncBytes = Base64.encodeBase64(authString.getBytes());
String authStringEnc = new String(authEncBytes);
System.out.println("Base64 encoded auth string: " + authStringEnc);
URL url = new URL(address);
URLConnection urlConnection = url.openConnection();
urlConnection.setRequestProperty("Authorization", "Basic "
+ authStringEnc);
InputStream is = urlConnection.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
And I'm trying to convert this to VBA, I'm not entirely sure how to handle it, or if there's some library that would facilitate this.
See Question&Answers more detail:os