aspose file tools*
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 JavaScript Promises Essentials this week in the JavaScript 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: 24187
    
  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