Re: Post using Query String
From: Michael Scovetta (nospam_googlegroups_at_scovetta.com)
Date: 03/17/04
- Next message: Gama Franco: "JNI"
- Previous message: Ryan Stewart: "Re: using a boolean to control a thread"
- In reply to: Bo Conroy: "Post using Query String"
- Next in thread: Nikk & Jak Anderson: "Re: Post using Query String"
- Reply: Nikk & Jak Anderson: "Re: Post using Query String"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
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
- Next message: Gama Franco: "JNI"
- Previous message: Ryan Stewart: "Re: using a boolean to control a thread"
- In reply to: Bo Conroy: "Post using Query String"
- Next in thread: Nikk & Jak Anderson: "Re: Post using Query String"
- Reply: Nikk & Jak Anderson: "Re: Post using Query String"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|