List
List
String urlStr = “https://charlotte.realforeclose.com/index.cfm?zaction=AUCTION&Zmethod=UPDATE&FNC=LOAD&AREA=W&PageDir=0&doR=1&tx=1563305131817&bypassPage=1&test=1&_=1563305131817”;
String str = null;
try {
URL url = new URL(urlStr);
HttpURLConnection con = (HttpURLConnection) url.openConnection();
con.setRequestMethod(“GET”);
con.setRequestProperty(“Host”, “charlotte.realforeclose.com”);
con.setRequestProperty(“Connection”, “keep-alive”);
con.setRequestProperty(“Accept”, “application/json, text/javascript, */*; q=0.01”);
con.setRequestProperty(“X-Requested-With”, “XMLHttpRequest”);
con.setRequestProperty(“User-Agent”, “Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/75.0.3770.100 Safari/537.36”);
con.setRequestProperty(“Origin”, “http://evil.com/”);
con.setRequestProperty(“Referer”, “https://charlotte.realforeclose.com/index.cfm?zaction=AUCTION&Zmethod=PREVIEW&AUCTIONDATE=07/23/2019”);
con.setRequestProperty(“Accept-Language”, “en-US,en;q=0.9”);
con.setRequestProperty(“Cookie”, “cfid=6f228aa1-bb7e-4734-92ff-39eabf23ed9b; cftoken=0; AWSELB=E7779D5F1C1F6ABE3513A5C5B6B0C754520B66675A407900314ABAC5333A52E93FD1A8D7401D89BC8D5E8B98059C8AAC5507D12A2C6ED07F7E7CB77311BD7FB09B738DB945; _ga=GA1.2.1823487290.1563231012; _gid=GA1.2.1418453663.1563231012; _gcl_au=1.1.273755450.1563231013; __utmc=65865852; __utmz=65865852.1563231014.1.1.utmcsr=realauction.com|utmccn=(referral)|utmcmd=referral|utmcct=/client-sites; CF_CLIENT_CHARLOTTE_REALFORECLOSE_TC=1563285507505; __utma=65865852.1823487290.1563231012.1563300430.1563305081.3; __utmt_UA-51657054-1=1; _gat=1; testcookiesenabled=disabled; CF_CLIENT_CHARLOTTE_REALFORECLOSE_LV=1563305130572; CF_CLIENT_CHARLOTTE_REALFORECLOSE_HC=1454; __utmb=65865852.4.10.1563305081”);
//handle cookies
//String cookiesHeader = con.getHeaderField(“Set-Cookie”);
//List
//CookieManager cookieManager = new CookieManager();
//cookies.forEach(cookie -> cookieManager.getCookieStore().add(null, cookie));
//con.disconnect();
//con = (HttpURLConnection) url.openConnection(); //create new connection with cookies
//con.setRequestProperty(“Cookie”, StringUtils.join(cookieManager.getCookieStore().getCookies(), “;”));
BufferedReader in = new BufferedReader(new InputStreamReader(con.getInputStream()));
StringBuilder stringBuilder = new StringBuilder();
while ((str = in.readLine()) != null) {
stringBuilder.append(str);
}
System.out.println(“Url: “+urlStr);
System.out.println(stringBuilder.toString());
in.close();
con.disconnect();
} catch (MalformedURLException ex) {
Logger.getLogger(CharlotteCtyFL.class.getName()).log(Level.SEVERE, null, ex);
} catch (IOException ex) {
Logger.getLogger(CharlotteCtyFL.class.getName()).log(Level.SEVERE, null, ex);
}
return properties;
}