Java URL example: Getting text from URL – Send HTTP request GET/POST in Java

Crunchify Call URL Example

How to send HTTP request GET/POST in Java? How to use java.net.URLConnection to fire and handle HTTP? Below is a simple example to get Response from URL in Java Program.

The URLConnection class contains many methods that let you communicate with the URL over the network. URLConnection is an HTTP-centric class; that is, many of its methods are useful only when you are working with HTTP URLs. However, most URL protocols allow you to read from and write to the connection. urlconnection getinputstream usage.

This section describes both functions.

Have anything to add to this article? Please chime in and join the conversion.
Tweet about this on TwitterShare on FacebookShare on Google+Pin on PinterestShare on TumblrBuffer this page

Enjoyed this post?

Be sure to subscribe to the Crunchify newsletter and get regular updates about awesome posts just like this one and more! Join more than 8000 subscribers!