当前位置: 首页>>代码示例>>Java>>正文


Java HttpClient.getAbs方法代码示例

本文整理汇总了Java中io.vertx.core.http.HttpClient.getAbs方法的典型用法代码示例。如果您正苦于以下问题:Java HttpClient.getAbs方法的具体用法?Java HttpClient.getAbs怎么用?Java HttpClient.getAbs使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.http.HttpClient的用法示例。


在下文中一共展示了HttpClient.getAbs方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: send

import io.vertx.core.http.HttpClient; //导入方法依赖的package包/类
private void send(String url, HttpMethod method, String content,
    int errorCode, Handler<HttpClientResponse> handler) {
  HttpClient client = StorageTestSuite.getVertx().createHttpClient();
  HttpClientRequest request;
  if (content == null) {
    content = "";
  }
  Buffer buffer = Buffer.buffer(content);

  switch (method) {
  case POST:
    request = client.postAbs(url);
    break;
  case DELETE:
    request = client.deleteAbs(url);
    break;
  case GET:
    request = client.getAbs(url);
    break;
  default:
    request = client.putAbs(url);
  }
  request.exceptionHandler(error -> {
    Assert.fail(error.getLocalizedMessage());
  })
  .handler(handler);
  request.putHeader("Authorization", "test_tenant");
  request.putHeader("x-okapi-tenant", "test_tenant");
  request.putHeader("Accept", "application/json,text/plain");
  request.putHeader("Content-type", SUPPORTED_CONTENT_TYPE_JSON_DEF);
  request.end(buffer);
}
 
开发者ID:folio-org,项目名称:deprecated-mod-metadata,代码行数:33,代码来源:LoanTypeTest.java

示例2: send

import io.vertx.core.http.HttpClient; //导入方法依赖的package包/类
private void send(String url, HttpMethod method, String content,
    String contentType, int errorCode, Handler<HttpClientResponse> handler) {
  HttpClient client = StorageTestSuite.getVertx().createHttpClient();
  HttpClientRequest request;
  if(content == null){
    content = "";
  }
  Buffer buffer = Buffer.buffer(content);

  if (method == HttpMethod.POST) {
    request = client.postAbs(url);
  }
  else if (method == HttpMethod.DELETE) {
    request = client.deleteAbs(url);
  }
  else if (method == HttpMethod.GET) {
    request = client.getAbs(url);
  }
  else {
    request = client.putAbs(url);
  }
  request.exceptionHandler(error -> {
    Assert.fail(error.getLocalizedMessage());
  })
  .handler(handler);
  request.putHeader("Authorization", "test_tenant");
  request.putHeader("x-okapi-tenant", "test_tenant");
  request.putHeader("Accept", "application/json,text/plain");
  request.putHeader("Content-type", contentType);
  request.end(buffer);
}
 
开发者ID:folio-org,项目名称:deprecated-mod-metadata,代码行数:32,代码来源:MaterialTypeTest.java


注:本文中的io.vertx.core.http.HttpClient.getAbs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。