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

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

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

HttpClient.delete介绍

[英]This method returns an HttpClientRequest instance which represents an HTTP DELETE 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删除请求。
当从服务器接收到HTTP响应时,将调用responseHandler传递响应。

代码示例

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

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

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

@Override
public void resourceDeleted(ResourceResponse resourceResponse) throws Exception {
  URI uri = destinationUri(resourceResponse.resource());
  HttpClientRequest request = this.httpClient.delete(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();
}

相关文章