I am working on HttpURLConnection class to do some network activity from my application. So i am wondering how the HttpURLConnection works internally. I gone through the class and found the connect() method defined as an abstract in URLConnection.
But i couldn't able to find the connect() method definition. So i am quite curious that , how HttpURLConnection connect to the server.
MyCode:
URL url = new URL("https://example.com");
connection = (HttpURLConnection) url.openConnection();
connection.setRequestProperty("Accept-Encoding", "identity");
connection.setRequestProperty("Authorization", basicAuth);
connection.setRequestProperty("Connection", "keep-alive");
connection.setRequestProperty("Content-type", "");
connection.setRequestProperty("User-Agent", "LibHttp/1.3.8");
connection.setRequestMethod("POST");
connection.connect(); // how it connects //
Please suggest me some solution.