0

How do we handle redirects(302 response code) in vertx HttpClientRequest. Is it possible to enable vertx itself to handle the redirects or we have to handle is explicitly. Please explain how to do it in case it needs to be done explicitly.

4

1 回答 1

4

The Vert.x HttpClient can be configured to follow redirects as explained in the documentation

client.get("some-uri", response -> {
  System.out.println("Received response with status code " + response.statusCode());
}).setFollowRedirects(true).end();
于 2017-09-26T16:06:23.547 回答