provided by: 
Originally published at Internet.comHTTP is the protocol that makes the Web click. It is generic enough to carry any type of data including HTML, raw data, image files, and XML. There are times when the resource your application needs is available from a Web site. You can see it by pointing your browser to its URL. You just need to have your Java application access it. The java.net.HttpURLConnection class will help you do just that. By encapsulating the HTTP protocol in a class, your application can interact with any resource that has an HTTP URL associated with it. This includes posting HTML forms to servlets and JSPs as if they were filled via a browser.

Piroz Mohseni
HttpURLConnection is an abstract class, so you can not directly instantiate it. When you create an instance of java.net.URL with an "http" URL and invoke its openConnection() method, you get an instance of HttpURLConnection. This instance will be your key to sending and receiving HTTP messages both directly or through a proxy server. Here is a code fragment that will result in creation of an instance of HttpURLConnection:
URL url = new URL("http://www.developer.com"); HttpURLConnection httpcon = url.openConnection(); ...
Read article at Internet.com site