Re: Post using Query String

From: Michael Scovetta (nospam_googlegroups_at_scovetta.com)
Date: 03/17/04


Date: 16 Mar 2004 16:12:48 -0800

First, I don't think IE or any other normal web browser will accept
post data from the command line. You could fudge something like this:
Use runtime to open:
   file://c:/temp/foo.html?post-data-here
--foo.html:
   <form action="actual-webserver" method="post">
   <script language="javascript">
     // parse the data sent from the query string,
     // create new "input type='hidden'" objects, add to the form
     // submit the form when done
   </script>

In other words, you have to have another server (or html file) convert
from GET to POST.

As for your 2nd question, you can use the HttpURLConnection or
URLConnection
to connect to a web server, then use doOutput() and getOutputStream()
to send the data in post format. I'm sure someone's written something
to make that a little easier, but it's fundamentally very simple.

Michael Scovetta

bconroy@ritchiecapital.com (Bo Conroy) wrote in message news:<b2c82121.0403161201.1f284439@posting.google.com>...
> I want to open up a web page from a java application in a new process
> using the Runtime.exec method. The problem is that the web page I
> want to open needs parameters passed to it via the POST method. Is
> there any way to use the query string to pass parameters and tell the
> server that a post is being done simply through a URL?
>
> My second question is the fallback if this cannot be done. I have not
> found yet how to open a URLConnection in a client application and do
> an HTTP Post to a URL. Any suggestions on where to look for that?
>
> Thanks,
>
> Bo



Relevant Pages

  • CHttpFile problem accessing HTTPS from ATL
    ... And i want to access from this component some secure web site ... to post data. ... Then i extract this code and put in separated dll. ... whatever i put as method it issue "GET" to the server and never "POST" ...
    (microsoft.public.vc.atl)
  • Creating POST data for Server.Transfer()?
    ... I want to programmatically create some POST data on a web server, ... I'm programming some buttons that link to PayPal's shopping cart. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: [PHP] accepting POST variables using CURL
    ... i have a HTML page when i submit the form i want ot read all teh POST ... There's the CLIENT which curl represents. ... You use curl to *send* POST data to the SERVER. ...
    (php.general)
  • Re: Creating POST data for Server.Transfer()?
    ... David Veeneman wrote: ... I'm concerned about the lack of security in that approach, so I want to have the button invoke a method on the server that will assemble the POST data that PayPal needs, and then redirect to PayPal. ...
    (microsoft.public.dotnet.languages.csharp)
  • http request using fsockopen
    ... On the start of page B I check var $foo. ... Sending the POST data also though the POST method. ... I manually create a HTTP request to page C and use the fsockopen method to ...
    (php.general)