How would I go about silently opening up a HTTP connection to a certain website in Java?
I tried .openConnection() and it didn’t work.
How would I go about silently opening up a HTTP connection to a certain
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You need to find out why
.openConnection()isn’t working. Catch the exception thrown by that call and print out the exception’s full stacktrace. That should give you the information you need to start diagnosing.The javadoc for
URL.openConnection()says this:That call can occur explicitly or implicitly; i.e. when you attempt to read the response status, headers or body. Read the javadocs for URLConnection and HttpURLConnection for more details.
So it sounds like
openConnectionis working … but it doesn’t do what you expect it to.