Vert.x HttpClient
2021-02-04 23:14
标签:end baidu response 发送请求 http depend https web lan 1、加入依赖 2、编写GET请求 POST请求和更多解释请到我的独立博客看原文 https://dev-tang.com/post/2020/06/httpclient-vert.x.html Vert.x HttpClient 标签:end baidu response 发送请求 http depend https web lan 原文地址:https://www.cnblogs.com/tangjizhong/p/13131998.htmlimport io.vertx.core.AbstractVerticle;
import io.vertx.core.Vertx;
import io.vertx.core.buffer.Buffer;
import io.vertx.ext.web.client.HttpResponse;
import io.vertx.ext.web.client.WebClient;
public class MainVerticle extends AbstractVerticle {
public static void main(String[] args) {
Vertx.vertx().deployVerticle(new MainVerticle());
}
@Override
public void start() throws Exception {
WebClient client = WebClient.create(vertx);
client.getAbs("http://www.baidu.com").send(ar -> {
if (ar.succeeded()) {
HttpResponse