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

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -