io.vertx.ext.web.client.WebClient.postAbs()方法的使用及代码示例

x33g5p2x  于2022-02-03 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(187)

本文整理了Java中io.vertx.ext.web.client.WebClient.postAbs()方法的一些代码示例,展示了WebClient.postAbs()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebClient.postAbs()方法的具体详情如下:
包路径:io.vertx.ext.web.client.WebClient
类名称:WebClient
方法名:postAbs

WebClient.postAbs介绍

暂无

代码示例

代码示例来源:origin: vert-x3/vertx-examples

client.postAbs(AUTH_URL)
 .as(BodyCodec.jsonObject())
 .addQueryParam("grant_type", "client_credentials")

代码示例来源:origin: io.vertx/vertx-rx-java

/**
 * Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive
 * the response
 * @param absoluteURI the absolute URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> postAbs(String absoluteURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.postAbs(absoluteURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

代码示例来源:origin: vert-x3/vertx-rx

/**
 * Create an HTTP POST request to send to the server using an absolute URI, specifying a response handler to receive
 * the response
 * @param absoluteURI the absolute URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> postAbs(String absoluteURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.postAbs(absoluteURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

代码示例来源:origin: io.vertx/vertx-web-client

@Test
public void testStreamHttpServerRequest() throws Exception {
 Buffer expected = TestUtils.randomBuffer(10000);
 HttpServer server2 = vertx.createHttpServer(new HttpServerOptions().setPort(8081)).requestHandler(req -> req.bodyHandler(body -> {
  assertEquals(body, expected);
  req.response().end();
 }));
 startServer(server2);
 WebClient webClient = WebClient.create(vertx);
 try {
  server.requestHandler(req -> webClient.postAbs("http://localhost:8081/")
   .sendStream(req, onSuccess(resp -> req.response().end("ok"))));
  startServer();
  webClient.post(8080, "localhost", "/").sendBuffer(expected, onSuccess(resp -> {
   assertEquals("ok", resp.bodyAsString());
   complete();
  }));
  await();
 } finally {
  server2.close();
 }
}

相关文章