File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes HttpURLConnection woes! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "HttpURLConnection woes!" Watch "HttpURLConnection woes!" New topic

HttpURLConnection woes!

Brian M Smith
Ranch Hand

Joined: Aug 13, 2009
Posts: 35
Hello there. I'm attempting to open up a http connection to a legacy web server. My particular problem is that when I open this request, I need to pass in a couple of cookies to the web server to duplicate a very particular request.

Here is the code I have written

The problem that I'm getting is that an IllegalStateException is being thrown due to the connection already being open. I have attempt to call the disconnect method on the connection variable but I'm getting the same results. If anyone could give me any advice on how to set cookies to the request, I would really appreciate it.
I agree. Here's the link:
subject: HttpURLConnection woes!
It's not a secret anymore!