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

sql - Return Function using Cursor -

sql server - How to use pivot in this table -

javascript - Is there any way to add a new parameter to a function programmatically? -