Reputation: 2251
I'm using vertx.io to make several HTTP requests, the input to the program is a file containing several full URLs. Checking the vertx.io HttpClient it seems like it can only query hosts but not full URLs. For example: it will successfully query http://www.yahoo.com/ but will fail on something like: http://finance.yahoo.com/news/us-stocks-slip-wal-mart-154834426.html
And so my questions are:
Googling these didn't find any good answers...
Thanks in advance!
Upvotes: 3
Views: 3978
Reputation: 1699
1: You can use the getAbs method:
client.getAbs("http://finance.yahoo.com/news/us-stocks-slip-wal-mart-154834426.html", response -> {
System.out.println("Received response with status code " + response.statusCode());
}).end();
Vertx HttpClient documentation
2: If you use it with the FutureCallback<HttpResponse>
callback parameter then it won't block the event loop.
Upvotes: 6