davidv7 Posted October 26, 2016 Report Share Posted October 26, 2016 This should be the relevant code. try { Log.w("URLString",result); connection = (new URL(result)).openConnection(); connection.setConnectTimeout(5000); connection.setReadTimeout(5000); connection.connect(); // Read and store the result line by line then return the entire string. InputStream in = connection.getInputStream(); BufferedReader reader = new BufferedReader(new InputStreamReader(in)); StringBuilder html = new StringBuilder(); for (String line; (line = reader.readLine()) != null; ) { html.append(line); } reader.close(); Log.w("Code ",html.toString()); } This is the URL i'm using. I'm connecting from my phone to my laptop(on the same wi-fi). readWebsite.execute("http://username:password@192.168.1.5:8080/gui/token.html"); Anyone got any ideas? I've been stuck on this forever, asked everyone I knew and no one could give me any advice. I've read some stuff about cookies, could that be it? Link to comment Share on other sites More sharing options...
davidv7 Posted October 26, 2016 Author Report Share Posted October 26, 2016 Am I missing the cookie thing? Shouldnt I be able to access the token without the cookie? Link to comment Share on other sites More sharing options...
davidv7 Posted October 30, 2016 Author Report Share Posted October 30, 2016 It appears as if I am missing the cookie thing. However I have no idea how to implement it. Where is the set-cookie header? Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.