Solved

Program to Send HTTP Post data

Posted on 2004-09-12
7
174 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
  • 2
  • 2
7 Comments
 
LVL 5

Expert Comment

by:Daij-Djan
Comment Utility
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
Comment Utility
Not very end-user friendly ;-)
0
 
LVL 5

Expert Comment

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

Author Comment

by:cdukes
Comment Utility
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
Comment Utility
PAQed, with points refunded (125)

modulo
Community Support Moderator
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
Wininet read php file from internet issue 6 68
tripleUp challenge 7 65
countX 22 68
Re-position sub-options beneath the TAB 7 36
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 learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.

763 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now