Remove unusd imports. Handle redirects properly.
This commit is contained in:
parent
1afe6eb0ba
commit
004e0efd6c
@ -1,13 +1,9 @@
|
||||
package sig;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.http.HttpRequest;
|
||||
import java.net.http.HttpResponse;
|
||||
import java.net.http.HttpResponse.BodyHandlers;
|
||||
|
||||
import sig.exceptions.FailedResponseException;
|
||||
import sig.requests.GETRequest;
|
||||
|
||||
public class client {
|
||||
public static void main(String[] args) {
|
||||
try {
|
||||
|
@ -1,6 +1,5 @@
|
||||
package sig.requests;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.IOException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
@ -59,7 +58,9 @@ public class GETRequest{
|
||||
.headers(headers)
|
||||
.timeout(Duration.ofMillis(timeout))
|
||||
.GET().build();
|
||||
client = HttpClient.newBuilder().build();
|
||||
client = HttpClient.newBuilder()
|
||||
.followRedirects(HttpClient.Redirect.ALWAYS)
|
||||
.build();
|
||||
} catch (URISyntaxException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user