Skip to content

Instantly share code, notes, and snippets.

View Human0722's full-sized avatar
🦄
Review

Human0722 Human0722

🦄
Review
View GitHub Profile
@Human0722
Human0722 / App.java
Created April 2, 2022 07:58 — forked from rponte/App.java
Downloading file using Apache HttpClient (>= v4.2) with support to HTTP REDIRECT 301 and 302 when using HTTP method GET or POST
public class App {
public static void main(String[] args) throws MalformedURLException {
URL rightUrl = new URL("http://cursos.triadworks.com.br/assets/css/main.css");
URL redirectableUrl = new URL("http://www.triadworks.com.br/assets/css/main.css"); // redirected to cursos.triadworks.com.br
Downloader downloader = new Downloader();
System.out.println("Downloading file through right Url...");