When I try to instantiate an HttpsURLConnection from an URL instance called "Server,"
HttpsURLConnection conn =(HttpsURLConnection) server.openConnection();
I got the following exception:
java.lang.ClassCastException: sun.net.www.protocol.http.HttpURLConnection incompatible with javax.net.ssl.HttpsURLConnection
May I know if there is anyway to solve it? I have to use HttpsURLConnection.
Thank you!