尝试使用 Vertx WebClient从此url下载文件但不工作。我在这里错过了什么吗?
// Create the web client and enable SSL/TLS with a trust store
WebClient client = WebClient.create(vertx,
new WebClientOptions()
.setSsl(false)
.setTrustAll(true)
.setDefaultPort(80)
.setKeepAlive(true)
.setDefaultHost("www.nasdaq.com"));
client.get(80, "www.nasdaq.com", "/screening/companies-by-industry.aspx")
.addQueryParam("exchange", "NASDAQ")
.addQueryParam("render", "download")
.putHeader("content-type","text/csv")
.as(BodyCodec.string())
.send(ar -> {
if (ar.succeeded()) {
// HttpResponse<Void> response = ar.result();
System.out.println("Received response with status code");
} else {
System.out.println("Something went wrong " + ar.cause().getMessage());
}
});