org.vertx.java.core.http.HttpClient.put()方法的使用及代码示例

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

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

HttpClient.put介绍

[英]This method returns an HttpClientRequest instance which represents an HTTP PUT request with the specified uri.

When an HTTP response is received from the server the responseHandler is called passing in the response.
[中]此方法返回一个HttpClientRequest实例,该实例表示具有指定uri的HTTP PUT请求。
当从服务器接收到HTTP响应时,将调用responseHandler传递响应。

代码示例

代码示例来源:origin: vert-x/mod-lang-php

/**
 * Executes a PUT request.
 */
public HttpClientRequest put(Env env, StringValue uri, Value handler) {
 PhpTypes.assertCallable(env, handler, "Argument to Vertx\\Http\\HttpClient::put() must be callable.");
 return new HttpClientRequest(client.put(uri.toString(), createResponseHandler(env, handler)));
}

代码示例来源:origin: liveoak-io/liveoak

@Override
public void sendAuthzError(ResourceState errorState, Resource resource, int status) throws Exception {
  URI uri = this.destination.resolve(resource.id());
  HttpClientRequest request = this.httpClient.put(uri.getPath(), (response) -> {
  });
  request.setChunked(true);
  RequestContext requestContext = new RequestContext.Builder().build();
  ByteBuf encoded = codec.encode(requestContext, errorState);
  request.write(new Buffer(encoded));
  request.end();
}

代码示例来源:origin: liveoak-io/liveoak

@Override
public void resourceUpdated(ResourceResponse resourceResponse) throws Exception {
  URI uri = destinationUri(resourceResponse.resource());
  HttpClientRequest request = this.httpClient.put(uri.getPath(), (response) -> {
  });
  request.setChunked(true);
  RequestContext requestContext = new RequestContext.Builder().build();
  ByteBuf encoded = codec.encode(requestContext, resourceResponse.state());
  request.write(new Buffer(encoded));
  request.end();
}

相关文章