Hi, I'm trying to authenticate to a website ( `https://myaccount.romtelecom.ro/info/login.jsp` ) using this code:
but I receive the login page source and not the page source that I'm being redirected to when I login using the browser.Code:byte[] be=Base64.encode("username:password".getBytes()); //Base64 class from http://www.bouncycastle.org/latest_releases.htm StringBuffer sbe=new StringBuffer(); for(int i=0;i<be.length;i++) sbe.append((char) be[i]); HttpsConnection hc=(HttpsConnection) Connector.open(url); hc.setRequestProperty("Authorization","Basic "+sbe.toString()); DataInputStream is=hc.openDataInputStream(); StringBuffer sb = new StringBuffer(); int rc; while((rc=is.read())!=-1) sb.append((char) rc); System.out.println(sb.toString());

Reply With Quote
) I know it's complicated and I can't get it to work. I don't think they have any API, pretty sure they don't ... Can I md5 a string in J2ME? Or do I need a library for it?


