HTTPS Login using Java -


I have a problem logging in to a website via https . Works) for http access is written:

  string user = user; String password = psw; String authString = user + ":" + password; Byte [] authEncBytes = Base64.encodeBase64 (authString.getBytes ()); String authStringEnc = new string (authEncBytes); URL Connection Connection = url.openConnection (); Connection.setRequestProperty ("Authority", "Basic" + authStringEnc); Connection.setRequestProperty ("content-type", "app / json"); Connection.setRequestProperty ("Accept", "App / JS"); Connection.connect ();   

I want to do the same thing but via https . Is this possible?

You can, please use

 HttpsURLConnection  < P> Checkout sample program   

Comments

Popular posts from this blog

python - how we can use ajax() in views.py in django? -

matlab - Using loops to get multiple values into a cell -

python - Sequence Pattern recognition with Pybrain -