On Mon, 23 Feb 2004, Miguel Howard wrote:
> If I put your data in here then this is what the URL will look like
>
> /cgi-bin/myCgi?user=Tommi+Hassinen&project=ghemical
>
> A POST is exactly the same, but the encoded string with all the
> parameters is passed to stdin instead of being part of the URL.
Ok, thanks, I think this is getting a bit clearer now. I found an example
of sending a POST request using Java, and it seems that the classes to be
used are URL and URLConnection (at least). The idea is that we have a
"form" as you explained:
> Let's say that we have a form with two fields. One called 'name' and the
> other called 'project'.
>
> [html]
> [body]
> [form action="/cgi-bin/myCgi" method="GET"]
> [input type="text" name="user" /][br /]
> [input type="text" name="project" /][br /]
> [input type="submit" /]
> [/form]
> [/body]
> [/html]
So we don't really use a form where user could edit the input, but instead
we wish to transfer the whole input file. Now the trick is that we pretend
that there is such a form, in a way that in out "form" there is only a
single field and it's value is the contents of the file that we wish to
transfer, right? So the parameter string would be
/cgi-bin/myCgi?input=blaa+blaa+blaa
where "input" is the name of our input field and "blaa+blaa+blaa" is the
encoded contents of the file that we want to pass (the length of the value
of a field is not limited, which is good :)
I found Java docs about those encoding/decoding classes. Could there be a
pre-processing step, so that what the web-server actually would run could
be a commmand like
decoder | ghemical-cgi
so that ghemical-cgi could directly read the decoded stream? If not I
think I have look at these later:
> Here is some c source code to do exactly the same thing:
> http://www.scit.wlv.ac.uk/~jphb/sst/c/cgisc.html
Regards,
Tommi
-------------------------------------------------------
SF.Net is sponsored by: Speed Start Your Linux Apps Now.
Build and deploy apps & Web services for Linux with
a free DVD software kit from IBM. Click Now!
http://ads.osdn.com/?ad_id=1356&alloc_id=3438&op=click
_______________________________________________
Jmol-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jmol-developers