This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes Sockets and Internet Protocols and the fly likes Problems with HttpURLConnection Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Problems with HttpURLConnection" Watch "Problems with HttpURLConnection" New topic
Author

Problems with HttpURLConnection

Brian Stelzer
Greenhorn

Joined: Oct 31, 2002
Posts: 29
I want to build a simple client application, that will get a urlconnection to a webpage. Send some post data. Get the page that it returns and sends some more post data to that next page... So far I haven't figured out a way to do that. I can use the URLConnection to send post, but what it returns is a InputStream. Is there anyway I can get the new page back in a more manageable format, like for instance have the URLConnection point to the next page that it returns so I can post some more data to that page...
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Moving this to the Sockets forum.


Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher
Robert Z
Greenhorn

Joined: Jan 18, 2001
Posts: 5
What's your question..??
this stream contains the result of your post
command
or an error page incase some error occurred..

robert
Michael Morris
Ranch Hand

Joined: Jan 30, 2002
Posts: 3451
Hi Robert,
Welcome to JavaRanch, the absolute best site on the www for Java information. We don't have many rules around here, but we do have one. Please change your display name to a first and last name to comply with the JavaRanch Naming Policy. You can change it here. Thank you for your cooperation.
Brian Stelzer
Greenhorn

Joined: Oct 31, 2002
Posts: 29
The question is: I know the address to the first page, and I know what information I need to post the result is another page that is returned. Well that page that is returned contains a post form also, so I would like to post some information to that page as well. I am wondering if I can do this all with only knowing the first pages address.
This is kind of the scenerio that I'm dealing with. The first page has a post form( I will enter my user id and password ), it will then send that form back to the webserver, and the servlet will pass back the result. This servlet is passing my session id around in the URL, this is why I need the same "handle" throughout this process.
Gabor Ui
Greenhorn

Joined: May 23, 2003
Posts: 7
hi,
here is a quite good book (i think good at basic level) with related package handling also forms and posting.
http://www.jeffheaton.com/java/bot/
http://www.jeffheaton.com/java/bot/updates.shtml
i can suggest to check it.
Gabor
 
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: Problems with HttpURLConnection
 
Similar Threads
pants down
Writing to a URLConnection object
HELP: travel agents and new java application
Forwarding a request to a sevlet inside context on another web server.
Multiple posts using HttpURLConnection