Solved

Program to Send HTTP Post data

Posted on 2004-09-12
7
184 Views
Last Modified: 2008-03-06
Is there a windows program already built that will allow me to send Post data to a server?
I want to post the same data multiple times throughout the day at specified times.
I need a program that can do this as opposed to a script like php, etc. something easy that end users can use.

0
Comment
Question by:cdukes
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
7 Comments
 
LVL 5

Expert Comment

by:Daij-Djan
ID: 12041549
code in java

  /**
   * Connect to the url specified and tell it via POSTing there is new data on the server.
   * @param url Url to call (can be anything  but should handle POSTs).
   * @param _strId id of the file we uploaded earilier (id=integer_as_string POSTed).
   */
  private static void ConnectToUrl( CURLConfig _oUrlConfig, String _strId ) throws IOException
  {
    URL url = _oUrlConfig.getConnection();
    URLConnection urlConn;
    DataOutputStream printout;
    DataInputStream input;
    // URL of CGI-Bin script.
    // URL connection channel.
    urlConn = url.openConnection();
    // Let the run-time system (RTS) know that we want input.
    urlConn.setDoInput( true );
    // Let the RTS know that we want to do output.
    urlConn.setDoOutput( true );
    // No caching, we want the real thing.
    urlConn.setUseCaches( false );
    // Specify the content type.
    urlConn.setRequestProperty( "Content-Type",
                        "application/x-www-form-urlencoded" );
    // Send POST output.
    printout = new DataOutputStream( urlConn.getOutputStream() );
    String content = "identifier=" + URLEncoder.encode( _strId ) + "&Login=" + URLEncoder.encode( _oUrlConfig.getUser() ) + "&Password=" + URLEncoder.encode( _oUrlConfig.getPassword() );
    printout.writeBytes( content );
    printout.flush();
    printout.close();
    // Get response data.
    input = new DataInputStream( urlConn.getInputStream() );
    String str;
    while ( null != ( ( str = input.readLine() ) ) )
    {
      System.out.println( str );
    }
    input.close();
  }
0
 

Author Comment

by:cdukes
ID: 12051116
Not very end-user friendly ;-)
0
 
LVL 5

Expert Comment

by:Daij-Djan
ID: 12053753
it is a method you can integrate into a small app - I dont understand what you need.
0
 

Author Comment

by:cdukes
ID: 12065951
I need the small app, something easy to use for an end-user.
...
I believe I have found what I am looking for though, so thanks for the advice anyways :-)

For anyone else who is searching for the same thing, here's a link:
http://www.codeproject.com/internet/httpget-post.asp
0
 

Accepted Solution

by:
modulo earned 0 total points
ID: 12446947
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Navigation is an important part of web design from a usability perspective. But it is often a pain when it comes to a developer’s perspective. By navigation, it often means menuing. This is less theory and more practical of how to get a specific gro…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question