Skip to content

Commit

Permalink
Due to HTTP compression response was not readable --> deactivated in …
Browse files Browse the repository at this point in the history
…HTTP Headers
  • Loading branch information
Felix Friebe committed Mar 5, 2020
1 parent cd16aac commit 1c2bfe2
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public String getGID(URL url) throws MalformedURLException {
// URL points to user portfolio, use user's full name as GID
String userInfoURL = "https://www.artstation.com/users/" + albumURL.getID() + "/quick.json";
try {
// groupData = Http.url(userInfoURL).getJSON();
// groupData = Http.url(userInfoURL).getJSON();
groupData = getJson(userInfoURL);
} catch (IOException e) {
throw new MalformedURLException("Couldn't load JSON from " + userInfoURL);
Expand Down Expand Up @@ -254,7 +254,7 @@ private ParsedURL parseURL(URL url) {
con.userAgent("Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:67.0) Gecko/20100101 Firefox/67.0");
con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
con.header("Accept-Language", "en-US,en;q=0.5");
con.header("Accept-Encoding", "gzip, deflate, br");
// con.header("Accept-Encoding", "gzip, deflate, br");
con.header("Upgrade-Insecure-Requests", "1");
Response res = con.execute();
int status = res.statusCode();
Expand Down Expand Up @@ -309,7 +309,7 @@ private JSONObject getJson(URL url) throws IOException {
"Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.11 (KHTML, like Gecko) Chrome/23.0.1271.95 Safari/537.11");
con.header("Accept", "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8");
con.header("Accept-Language", "en-US,en;q=0.5");
con.header("Accept-Encoding", "gzip, deflate, br");
// con.header("Accept-Encoding", "gzip, deflate, br");
con.header("Upgrade-Insecure-Requests", "1");
Response res = con.execute();
int status = res.statusCode();
Expand Down

0 comments on commit 1c2bfe2

Please sign in to comment.