Support Forums
Help With HttpConnection - Printable Version

+- Support Forums (https://www.supportforums.net)
+-- Forum: Categories (https://www.supportforums.net/forumdisplay.php?fid=87)
+--- Forum: Coding Support Forums (https://www.supportforums.net/forumdisplay.php?fid=18)
+---- Forum: Java Programming (https://www.supportforums.net/forumdisplay.php?fid=22)
+---- Thread: Help With HttpConnection (/showthread.php?tid=26771)



Help With HttpConnection - Sutton2k9 - 07-19-2012

I have been trying to get this working for some time now and it just don't seem to work.

Code:
public void sendRequest(String request_url){
        try {
            URL url = new URL(request_url);
            HttpURLConnection conn = (HttpURLConnection) url.openConnection();
            conn.setRequestMethod("GET");
            conn.connect();
            InputStream in = conn.getInputStream();
            BufferedReader reader = new BufferedReader(new InputStreamReader(in));
            String text = reader.readLine();
            Logger.log(this, "Error " + text);

            conn.disconnect();
            
        } catch (Exception e) {
            Logger.log(this, "Error " + e.toString());
        }  
    }

I get the following error.

Code:
java io.FileNotFoundException : http://runegalaxy.org/Hs/



RE: Help With HttpConnection - Clarencetew24 - 05-19-2017

gOOGLE get this working for some time now and it just don't seem to work.


RE: Help With HttpConnection - AdilahBisar - 05-24-2019

i want to ask something please help me????????