我正在使用vertx.io发出多个HTTP请求,该程序的输入是一个包含几个完整URL的文件。检查vertx.io HttpClient似乎只能查询主机,但不能查询完整URL。例如:它将成功查询http://www.yahoo.com/,但失败,例如:http : //finance.yahoo.com/news/us-stocks-slip-wal-mart-154834426.html
所以我的问题是:
谷歌搜索这些没有找到任何好的答案...
提前致谢!
1:可以使用getAbs方法:
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();
Run Code Online (Sandbox Code Playgroud)
2:如果将其与FutureCallback<HttpResponse>
callback参数一起使用,则它将不会阻塞事件循环。