Results 1 to 5 of 5
  1. #1
    mehdi_s2 is offline Member
    Join Date
    Apr 2012
    Posts
    4
    Rep Power
    0

    Default How to send a post request to website via java

    Hi
    I have some problems with post method in html web sites.
    can you tel how to send a post request to website via java desktop application?
    for example imagine a form like this :

    <form id="frm-13355796114f9b53db8d171"method="post"

    action="http://www.someexample.com/profile/login/authenticate/atrty/1335579611/avrvy//key/4991f7eb6719a9920d19baea68c7dfaa1d46a6d2/">

    <input type="text" name="data[username]" id="username" value="" class="formText english" />

    <input type="password" name="data[password]" id="password" value="" class="english" />

    <input type="checkbox" name="data[invisible]" id="invisible" value="1" class="english" />

    <input type="hidden" name="data[loginfrom]" value="" class="english" id="loginfrom" />

    <input type="hidden" name="secfrdcodedvar" id="secfrdcodedvar" value="44b67c246d35897489956382c7a17979bdb467c5" />

    <input type="submit" name="btnSubmit" id="btnSubmit" value="????" class="btn" />

    <input type="hidden" name="frm-id" value="13355796114f9b53db8d171" id="frm-id" />

    </form>

    what is the java code to send a post request ?
    Thanks

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: How to send a post request to website via java

    See Lesson: Working with URLs (The Java™ Tutorials > Custom Networking)
    especially the 'writing to' a URLConnection section

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,189
    Rep Power
    19

    Default Re: How to send a post request to website via java

    Moved from Advanced Java

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    danoc93 is offline Member
    Join Date
    Apr 2012
    Posts
    37
    Rep Power
    0

    Default Re: How to send a post request to website via java

    Try the httpserver apache libraries... they are really powerful... I used them to login into my website from my program...

  5. #5
    homesting is offline Member
    Join Date
    May 2012
    Posts
    4
    Rep Power
    0

    Default Re: How to send a post request to website via java

    You can try Apache HttpComponents,URL:Apache HttpComponents,It will help you to simulate browser.Request Http server and get response data.

Similar Threads

  1. proxy ip send post request
    By rojersjoo in forum Networking
    Replies: 4
    Last Post: 02-18-2012, 02:36 AM
  2. Authenticating for a java POST request
    By stodds in forum Advanced Java
    Replies: 1
    Last Post: 12-08-2010, 12:11 AM
  3. how to post data to a website using java
    By mr_anderson in forum Advanced Java
    Replies: 6
    Last Post: 11-12-2010, 11:46 AM
  4. HTTP Post Request from Java
    By Darrarski in forum New To Java
    Replies: 10
    Last Post: 06-05-2010, 05:22 PM
  5. Replies: 1
    Last Post: 07-14-2007, 05:15 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •