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

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

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

WebClient.put介绍

暂无

代码示例

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

@Override
 public void start() throws Exception {

  WebClient client = WebClient.create(vertx);

  JsonObject user = new JsonObject()
   .put("firstName", "Dale")
   .put("lastName", "Cooper")
   .put("male", true);

  client.put(8080, "localhost", "/").sendJson(user, ar -> {
   if (ar.succeeded()) {
    HttpResponse<Buffer> response = ar.result();
    System.out.println("Got HTTP response with status " + response.statusCode());
   } else {
    ar.cause().printStackTrace();
   }
  });
 }
}

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

@Override
 public void start() throws Exception {

  WebClient client = WebClient.create(vertx);

  Buffer body = Buffer.buffer("Hello World");

  client.put(8080, "localhost", "/").sendBuffer(body, ar -> {
   if (ar.succeeded()) {
    HttpResponse<Buffer> response = ar.result();
    System.out.println("Got HTTP response with status " + response.statusCode());
   } else {
    ar.cause().printStackTrace();
   }
  });
 }
}

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

@Override
 public void start() throws Exception {

  WebClient client = WebClient.create(vertx);

  User user = new User();
  user.firstName = "Dale";
  user.lastName = "Cooper";
  user.male = true;

  client.put(8080, "localhost", "/").sendJson(user, ar -> {
   if (ar.succeeded()) {
    HttpResponse<Buffer> response = ar.result();
    System.out.println("Got HTTP response with status " + response.statusCode());
   } else {
    ar.cause().printStackTrace();
   }
  });
 }
}

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

@Override
 public void start() throws Exception {

  String filename = "upload.txt";
  FileSystem fs = vertx.fileSystem();

  WebClient client = WebClient.create(vertx);

  fs.props(filename, ares -> {
   FileProps props = ares.result();
   System.out.println("props is " + props);
   long size = props.size();

   HttpRequest<Buffer> req = client.put(8080, "localhost", "/");
   req.putHeader("content-length", "" + size);

   fs.open(filename, new OpenOptions(), ares2 -> {
    req.sendStream(ares2.result(), ar -> {
     if (ar.succeeded()) {
      HttpResponse<Buffer> response = ar.result();
      System.out.println("Got HTTP response with status " + response.statusCode());
     } else {
      ar.cause().printStackTrace();
     }
    });
   });
  });
 }
}

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

/**
 * Create an HTTP PUT request to send to the server at the specified host and default port.
 * @param host the host
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(String host, String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

/**
 * Create an HTTP PUT request to send to the server at the specified host and default port.
 * @param host the host
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(String host, String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

/**
 * Create an HTTP PUT request to send to the server at the specified host and port.
 * @param port the port
 * @param host the host
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(int port, String host, String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(port, host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

/**
 * Create an HTTP PUT request to send to the server at the default host and port.
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

/**
 * Create an HTTP PUT request to send to the server at the default host and port.
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

/**
 * Create an HTTP PUT request to send to the server at the specified host and port.
 * @param port the port
 * @param host the host
 * @param requestURI the relative URI
 * @return an HTTP client request object
 */
public io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> put(int port, String host, String requestURI) { 
 io.vertx.rxjava.ext.web.client.HttpRequest<io.vertx.rxjava.core.buffer.Buffer> ret = io.vertx.rxjava.ext.web.client.HttpRequest.newInstance(delegate.put(port, host, requestURI), io.vertx.rxjava.core.buffer.Buffer.__TYPE_ARG);
 return ret;
}

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

break;
case PUT:
 builder = client.put(DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, "/somepath");
 break;
case PATCH:

相关文章