wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes POST request from Java app Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "POST request from Java app" Watch "POST request from Java app" New topic
Author

POST request from Java app

Kedar Dravid
Ranch Hand

Joined: May 28, 2004
Posts: 333
Is it possible to make a POST request from within a Java application. How exactly can this be achieved?
Nathaniel Stoddard
Ranch Hand

Joined: May 29, 2003
Posts: 1258
Yes. Take a look at the classes in the java.net package.


Nathaniel Stodard<br />SCJP, SCJD, SCWCD, SCBCD, SCDJWS, ICAD, ICSD, ICED
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24183
    
  34

More specifically, you want to use the URLConnection class. The "setDoOutput()" method is the key to whether you'll make a GET or a POST.


[Jess in Action][AskingGoodQuestions]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: POST request from Java app
 
Similar Threads
How to make a 'post' request from an application to a Servlet
Foward an http request from a servlet to an Oracle Package Procedure
What's the difference?
Struts error analysis
http method