Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void HtmlCookie() throws Exception
- {
- URL url = new URL("http://intranet2.kbtu.kz/home.aspx");
- HttpURLConnection connection = null;
- connection = (HttpURLConnection) url.openConnection();
- connection.setRequestProperty("User-Agent", "Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6");
- connection.setRequestProperty("Cookie", "uname=AQAAANCMnd8BFdERjHoAwE%2fCl%2bsBAAAAdEBpNRprKkuhk%2fnIwaLLPgQAAAACAAAAAAADZgAAqAAAABAAAADZqjhvec%2bV30HPxZ7khpUvAAAAAASAAACgAAAAEAAAAEQ9EI8%2bQHNdK8RjqtcJRrYgAAAAIbTnx5Q0HjHreoZn8Q5TIVluiwUapbiqYZY%2fdYYzC84UAAAApN%2bIOFgfcLv7r%2fLO3wV4hPG%2f%2bOM%3d;");
- connection.connect();
- String inputLine;
- BufferedReader in = new BufferedReader(new InputStreamReader(connection.getInputStream(), "UTF8"));
- while ((inputLine = in.readLine()) != null)
- System.out.println(inputLine);
- in.close();
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement