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

Crunchify Call URL Example Java URL example: Getting text from URL   Send HTTP request GET/POST in Java

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.
twitter Java URL example: Getting text from URL   Send HTTP request GET/POST in Javafacebook Java URL example: Getting text from URL   Send HTTP request GET/POST in Javagoogle Java URL example: Getting text from URL   Send HTTP request GET/POST in Javapinterest Java URL example: Getting text from URL   Send HTTP request GET/POST in Javatumblr Java URL example: Getting text from URL   Send HTTP request GET/POST in Javabuffer Java URL example: Getting text from URL   Send HTTP request GET/POST in Java

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!