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

sonata admin - how to add ManyToOne property field in configureListfield in sonataAdmin -

wpf - ControlTemplate with changes for every class -

sql - Return Function using Cursor -