w*********n 发帖数: 84 | 1 【 以下文字转载自 Java 讨论区 】
【 原文由 williamchen 所发表 】
commonly, we just input a URL in a web browser and fill in
the blank and click the 'submit' button.
How could we create java program submit the information to
the server side program directly without opening any browser?
Any example code for that?
Thanks a lot. | a*p 发帖数: 62 | 2 1. You may use java.net.URLConnection for this aim
2. If you want to do some complicated submit, you may need
to read HTTP standard(RFC) and programming directly.
【在 w*********n 的大作中提到】 : 【 以下文字转载自 Java 讨论区 】 : 【 原文由 williamchen 所发表 】 : commonly, we just input a URL in a web browser and fill in : the blank and click the 'submit' button. : How could we create java program submit the information to : the server side program directly without opening any browser? : Any example code for that? : Thanks a lot.
| w*********n 发帖数: 84 | 3 Thanks a lot.
I think my this task is quite complicated, since I'll have to
submit more than one piece of information plus some long ASCII
sequence.
Is there any sample codes for this programming purpose?
Thanks again!
【在 a*p 的大作中提到】 : 1. You may use java.net.URLConnection for this aim : 2. If you want to do some complicated submit, you may need : to read HTTP standard(RFC) and programming directly.
| a*p 发帖数: 62 | 4 1.the first question is what is your server program? If your
server program is a normal CGI program (like PHP, Perl etc),
then you have to program using HTTP. I've not seen such java
java program before and I bet it is a little complicated.
2. If your server program will be made by yourself, then you
may do a very simple socket programming, there should be a
lot examples on the web. But note that in IE you can only
create socket to your web host. Say if your java program is
located in http://pig
【在 w*********n 的大作中提到】 : Thanks a lot. : I think my this task is quite complicated, since I'll have to : submit more than one piece of information plus some long ASCII : sequence. : Is there any sample codes for this programming purpose? : Thanks again!
|
|