Reputation: 1989
I have this very simple Verticle:
class PingVerticle : AbstractVerticle() {
override fun start() {
var options = WebClientOptions().setSsl(true).setVerifyHost(false).setTrustAll(true);
WebClient.create(vertx, options)
.get(443, "https://google.com", "")
.ssl(true)
.send { r ->
if(r.succeeded()) {
var r = r.result();
println(r.statusCode())
} else {
println("failed")
}
}
}
}
And I always get result 400 - Bad Request. Any ideas what I do wrong here?..
Upvotes: 0
Views: 676
Reputation: 9128
The get
method that you used takes 3 arguments:
So it should be:
webClient
.get(443, "google.com", "")
.ssl(true)
Or, using getAbs
, just:
webClient
.getAbs("https://google.com")
Question author update: Please read discussion under this answer to understand the full picture. Even though the answer makes sense, due to the fact that maybe question was formulated badly this answer doesn't fully solves it, but comments under it might.
Upvotes: 1