Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Help With HttpConnection
#1
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/
Reply
#2
gOOGLE get this working for some time now and it just don't seem to work.
Reply
#3
i want to ask something please help me????????
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)