What am I doing wrong? Please have a look at code.
HttpURLConnection conn = (HttpURLConnection) new URL(http_url).openConnection();
conn.setRequestMethod("GET");
BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
/*
java.io.IOException: Server returned HTTP response code: 400 for URL: http_url
at sun.net.www.protocol.http.HttpURLConnection.getInputStream
*/
If I open the http_url in browser, it's working.
conn.getErrorStream()in case of response code >= 400.