Is this the right sub-forum of Java Ranch for this post??
Trying to create java application that will download a file from a website (e.g. www.website1.com).
Following excerpt generally works ok.
redirects to www.website2.com,
so huc.getResponseCode() <above> returns 302 rather than 0. I tried inserting
but still get 302 rather than 0. How do I supply my UserID/Passwd to handle the redirect?
More generally, I'd like to not have to supply the UserId/Passwd with each GET request. Instead, I want to (somehow) login to website1 or website2 at the start of the app (only). Is this doable?
As a last resort, could I create an applet to download the file. From Firefox, if I login to website1 (thru website2), then any other "tabs" in that Firefox session are "authorized". Any reason why this approach won't work?
Request insights, coding samples, website references...