-5

Possible Duplicate:
How to send HTTP request in java?

I have a basic query that I want to write a core Java program that will make a http request.

Let say it will hit and open any website, so how can I write this core java program that will hit the and open any website. I am fully aware that this thing can be achieved with servlets and other advanced framework, also but I want to do it with core Java program.

Please advise how this thing can be achieved in Java?

Community
  • 1
  • 1
  • [java.net](http://docs.oracle.com/javase/6/docs/api/index.html?java/net/package-summary.html) has the classes you need. – Denys Séguret Jan 10 '13 at 18:32
  • Duplicate: http://stackoverflow.com/questions/238547/how-do-you-programmatically-download-a-webpage-in-java – Adrián Jan 10 '13 at 18:34
  • I'd recommend [this](http://help.eclipse.org/indigo/index.jsp?topic=%2Forg.eclipse.platform.doc.isv%2Fguide%2Frcp_browser.htm) example – Roman C Jan 10 '13 at 18:48

1 Answers1

1

You should look at HttpComponents. If you just want to do it with the technology that comes within the JDK, you should look at URLConnection.

Daniel Kaplan
  • 54,448
  • 39
  • 189
  • 282