I'm a greenhorn. I'm an experienced (actually, just old) programmer, but new to Java. I've read Head First Java and am trying to muddle through some simple but real initial applications.
I'm looking for examples of simple java client apps that query (i.e. submit POST requests with form parameters to) web pages. I can find lots about writing servlets to respond to such requests, but haven't found anything that shows how to emulate a browser sending the request. (I have found examples of that perform GET operations by simply opening a URL stream.) Any suggestions on how to explore this functionality would be appreaciated. Thanks.
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12266
1
posted
0
You might find the HttpClient toolkit useful for emulating the browser side of web application interaction. For example, it can handle cookies like a browser does. Bill
I second Franks suggestion of HttpUnit. Don't let the fact that it has its roots in unittesting turn you off - it is a very handy tool for accessing web pages, and it can even deal with simple JavaScript. It has its own API that lets you access the contents of the web page, but also presents that web page as a DOM object, so there are a number of possibilities for further processing.