Skip to content

Instantly share code, notes, and snippets.

@akeinhell
Created November 27, 2013 17:09
Show Gist options
  • Save akeinhell/7679355 to your computer and use it in GitHub Desktop.
Save akeinhell/7679355 to your computer and use it in GitHub Desktop.
sample JSoup XMLHttpRequest with cookies
Document doc = Jsoup.connect(jurl)
.header("Accept","text/html, */*; q=0.01")
.header("Accept-Encoding","gzip,deflate,sdch")
.header("Accept-Language","ru-RU,ru;q=0.8,en-US;q=0.6,en;q=0.4")
.header("Connection","keep-alive")
.header("Cookie",cookie)
.header("Host","rivalregions.com")
.header("Referer","http://rivalregions.com/")
.header("User-Agent","Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/31.0.1650.57 Safari/537.36")
.header("X-Requested-With", "XMLHttpRequest")
//.cookie(genUrl(),cookie)
.get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment