This week's book giveaway is in the OCMJEA forum. We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line! See this thread for details.
I am getting this exception "java.io.IOException: Server returned HTTP response code: 400" while getting InputStream. Whereas, hitting the same URL in IExplorer gave the successful response. Please find below the code. Please help. Thanks.
URL hostURL = new URL("http://www.domain.com/abc?paramters=values");
HttpURLConnection urlcon = (HttpURLConnection) hostURL.openConnection();
//urlcon.connect(); --tried this one also...same exception
InputStream is=urlcon.getInputStream(); -- exception occurs at this line.