I am setting up a connection with a site that requires a username and password, but it does not connect, and I do not know why you can help me with this, please?
This is the code I'm using.
{ HttpsConnection connection; connection = (HttpsConnection) Connector.open(url + getBlackBerryConnectionParams()); connection.setRequestProperty("Authorization", "Basic" + new String(getEncode())); } public byte[] getEncode() { String login = "user:@@iPass"; byte[] encoded = null; try { encoded = Base64OutputStream.encode(login.getBytes(), 0, login.length(), false, false); } catch (IOException e) {
The actual password starts with "@@" and there is a capital letter
source share