This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
I have posted about this project a couple of days ago. I am a beginner with Java a need to do a project that needs to connect to a web site, post a HTML form to a URL, and get back some information. If the documentation tells you that a HTML form needs to be sent up and the only way I can do this is to create the HTML form created by Java. Will the web server that is requesting the HTML form be able to process the Java created HTML form the same way. I am not quite sure how the process is handled. Sandy
Here's a link that will give you a good background on HTTP. http://www.jmarshall.com/easy/http/ Also, you will need to know which parameters (ie parameter names) that the service you will be calling expects (Is there an existing HTML form page setup?, if so then you can just look at the HTML source to see which parameters are required). Here is some code which can form a outline of what you will be doing:
Currently this code does a HTTP GET request (you will understand this after reading the above link) to http://www.google.com, and then reads back the HTTP response from google's webserver, ie the HTML that makes up googles default search interface. Also, commented out in the code, is an example on how to do an HTTP POST as well. Anway, I think that covers most of what you need to achieve for your project. Good luck.
Joined: Mar 14, 2002
Thanks James, I can't begin to tell you how much I appreciate this information. Sandy