io.vertx.core.http.HttpClient.postAbs()方法的使用及代码示例

x33g5p2x  于2022-01-20 转载在 其他  
字(4.3k)|赞(0)|评价(0)|浏览(200)

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

HttpClient.postAbs介绍

[英]Create an HTTP POST request to send to the server using an absolute URI
[中]使用绝对URI创建要发送到服务器的HTTP POST请求

代码示例

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

/**
 * Create an HTTP POST request to send to the server using an absolute URI
 * @param absoluteURI the absolute URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.core.http.HttpClientRequest postAbs(String absoluteURI) { 
 io.vertx.rxjava.core.http.HttpClientRequest ret = io.vertx.rxjava.core.http.HttpClientRequest.newInstance(delegate.postAbs(absoluteURI));
 return ret;
}

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

/**
 * Create an HTTP POST request to send to the server using an absolute URI
 * @param absoluteURI the absolute URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.core.http.HttpClientRequest postAbs(String absoluteURI) { 
 io.vertx.rxjava.core.http.HttpClientRequest ret = io.vertx.rxjava.core.http.HttpClientRequest.newInstance(delegate.postAbs(absoluteURI));
 return ret;
}

代码示例来源: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
 * @param responseHandler the response handler
 * @return an HTTP client request object
 */
@Deprecated()
public io.vertx.rxjava.core.http.HttpClientRequest postAbs(String absoluteURI, Handler<io.vertx.rxjava.core.http.HttpClientResponse> responseHandler) { 
 io.vertx.rxjava.core.http.HttpClientRequest ret = io.vertx.rxjava.core.http.HttpClientRequest.newInstance(delegate.postAbs(absoluteURI, new Handler<io.vertx.core.http.HttpClientResponse>() {
  public void handle(io.vertx.core.http.HttpClientResponse event) {
   responseHandler.handle(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(event));
  }
 }));
 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
 * @param responseHandler the response handler
 * @return an HTTP client request object
 */
public io.vertx.rxjava.core.http.HttpClientRequest postAbs(String absoluteURI, Handler<AsyncResult<io.vertx.rxjava.core.http.HttpClientResponse>> responseHandler) { 
 io.vertx.rxjava.core.http.HttpClientRequest ret = io.vertx.rxjava.core.http.HttpClientRequest.newInstance(delegate.postAbs(absoluteURI, new Handler<AsyncResult<io.vertx.core.http.HttpClientResponse>>() {
  public void handle(AsyncResult<io.vertx.core.http.HttpClientResponse> ar) {
   if (ar.succeeded()) {
    responseHandler.handle(io.vertx.core.Future.succeededFuture(io.vertx.rxjava.core.http.HttpClientResponse.newInstance(ar.result())));
   } else {
    responseHandler.handle(io.vertx.core.Future.failedFuture(ar.cause()));
   }
  }
 }));
 return ret;
}

代码示例来源:origin: folio-org/okapi

private void postUrl(String url, String msg,
 Handler<AsyncResult<Void>> future) {
 HttpClientRequest req = client.postAbs(url, res -> handle204(res, msg, future));
 req.exceptionHandler(d -> future.handle(Future.failedFuture(d.getCause())));
 req.end();
}

代码示例来源:origin: folio-org/okapi

private void postUrlBody(String url, String doc,
 Handler<AsyncResult<Void>> future) {
 HttpClientRequest req = client.postAbs(url, res -> {
  Buffer body = Buffer.buffer();
  res.exceptionHandler(d -> future.handle(Future.failedFuture(d.getCause())));
  res.handler(body::appendBuffer);
  res.endHandler(d -> {
   if (res.statusCode() >= 200 && res.statusCode() <= 201) {
    containerId = body.toJsonObject().getString("Id");
    future.handle(Future.succeededFuture());
   } else {
    String m = "createContainer HTTP error "
     + Integer.toString(res.statusCode()) + "\n"
     + body.toString();
    logger.error(m);
    future.handle(Future.failedFuture(m));
   }
  });
 });
 req.exceptionHandler(d -> future.handle(Future.failedFuture(d.getCause())));
 req.putHeader("Content-Type", "application/json");
 req.end(doc);
}

代码示例来源:origin: com.github.susom/vertx-base

httpClient.postAbs(tokenUrl, mdc(response -> {
 metric.checkpoint("response");
 response.bodyHandler(mdc(body -> {

代码示例来源:origin: com.github.susom/vertx-base

httpClient.postAbs(tokenUrl, mdc(response -> {
 metric.checkpoint("response");
 response.bodyHandler(mdc(body -> {

相关文章