HTTP communication

Web communication is done using HTTP (HyperText Transfer Protocol). To communicate on the web with HTTP you can use the URLConnection class, which has methods and properties that enable you to do all types of web communication such as retrieving the contents at a URL or posting to a form.

Getting web content

You can send a web request to a URL to get back content. This content could be the actual content of a web page if you URL is a web page or it could be binary content if your URL is to a file or it could be data or some form if your URL points to a web service API call. To send these web requests you use the URLConnection class.