io.vertx.reactivex.core.MultiMap.add()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(7.2k)|赞(0)|评价(0)|浏览(142)

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

MultiMap.add介绍

暂无

代码示例

代码示例来源:origin: io.knotx/knotx-core

@Override
public BiConsumer<MultiMap, T> accumulator() {
 return (multiMap, t) -> value.apply(t)
   .forEach(v -> multiMap.add(keyGetter.apply(t), v));
}

代码示例来源:origin: Cognifide/knotx

private KnotContext redirectKnotResponse(KnotContext knotContext, FormEntity form,
  ClientResponse clientResponse, String redirectLocation) {
 LOGGER.debug("Request redirected to [{}]", redirectLocation);
 knotContext.getClientResponse()
   .setStatusCode(HttpResponseStatus.MOVED_PERMANENTLY.code());
 MultiMap headers = MultiMap.caseInsensitiveMultiMap();
 headers.addAll(getFilteredHeaders(clientResponse.getHeaders(),
   form.adapter().getAllowedResponseHeadersPatterns()));
 headers.add(HttpHeaders.LOCATION.toString(), redirectLocation);
 knotContext.getClientResponse().setHeaders(headers);
 knotContext.clearFragments();
 return knotContext;
}

代码示例来源:origin: Cognifide/knotx

@Override
public BiConsumer<MultiMap, T> accumulator() {
 return (multiMap, t) -> value.apply(t)
   .forEach(v -> multiMap.add(keyGetter.apply(t), v));
}

代码示例来源:origin: io.knotx.acme/acme-gateway

private MultiMap getHeaders(ClientResponse clientResponse, int bodyLength) {
 MultiMap headers = clientResponse.getHeaders();
 headers.add(HttpHeaders.CONTENT_LENGTH.toString().toLowerCase(),
   Integer.toString(bodyLength))
   .add("Content-Type", "application/json");
 return headers;
}

代码示例来源:origin: io.knotx/knotx-example-gateway

private MultiMap getHeaders(ClientResponse clientResponse, int bodyLength) {
 MultiMap headers = clientResponse.getHeaders();
 headers.add(HttpHeaders.CONTENT_LENGTH.toString().toLowerCase(),
   Integer.toString(bodyLength))
   .add("Content-Type", "application/json");
 return headers;
}

代码示例来源:origin: Cognifide/knotx

private MultiMap headers(Optional<String> contentType) {
 MultiMap headers = MultiMap.caseInsensitiveMultiMap();
 contentType.ifPresent(s -> headers.add("Content-Type", s));
 return headers;
}

代码示例来源:origin: io.knotx/knotx-repository-connector-filesystem

private MultiMap headers(Optional<String> contentType) {
 MultiMap headers = MultiMap.caseInsensitiveMultiMap();
 contentType.ifPresent(s -> headers.add("Content-Type", s));
 return headers;
}

代码示例来源:origin: io.knotx/knotx-core

private MultiMap headers(Optional<String> contentType) {
 MultiMap headers = MultiMap.caseInsensitiveMultiMap();
 contentType.ifPresent(s -> headers.add("Content-Type", s));
 return headers;
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-core

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: Cognifide/knotx

private void writeHeaders(final HttpServerResponse response,
  final ClientResponse clientResponse) {
 clientResponse.getHeaders().names().stream()
   .filter(this::headerFilter)
   .forEach(
     name ->
       clientResponse.getHeaders()
         .getAll(name)
         .forEach(value -> response.headers().add(name, value))
   );
 response.headers().remove(HttpHeaders.CONTENT_LENGTH.toString());
}

代码示例来源:origin: io.knotx/knotx-server

@Override
 public void handle(RoutingContext context) {
  if (customHeader.containsKey("name") && customHeader.containsKey("value")) {
   context.response().headers()
     .add(customHeader.getString("name"), customHeader.getString("value"));
  }
  context.next();
 }
}

代码示例来源:origin: io.knotx/knotx-core

@Override
 public void handle(RoutingContext context) {
  if (customHeader != null) {
   context.response().headers()
     .add(customHeader.getName(), customHeader.getValue());
  }
  context.next();
 }
}

代码示例来源:origin: Cognifide/knotx

@Override
 public void handle(RoutingContext context) {
  if (customHeader != null) {
   context.response().headers()
     .add(customHeader.getName(), customHeader.getValue());
  }
  context.next();
 }
}

代码示例来源:origin: io.knotx.acme/acme-forms-adapter-http

private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest,
  HttpFormsSettings serviceMetadata) {
 MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(),
   serviceMetadata.getAllowedRequestHeadersPatterns());
 filteredHeaders.names().forEach(
   headerName -> filteredHeaders.getAll(headerName)
     .forEach(value -> request.headers().add(headerName, value)));
 if (customHttpHeader != null) {
  request.headers().set(
    customHttpHeader.getName(),
    customHttpHeader.getValue()
  );
 }
}

代码示例来源:origin: io.knotx/knotx-databridge-adapter-http

private void updateRequestHeaders(HttpRequest<Buffer> request, ClientRequest serviceRequest,
                 HttpDataSourceSettings serviceMetadata) {
 MultiMap filteredHeaders = getFilteredHeaders(serviceRequest.getHeaders(),
   serviceMetadata.getAllowedRequestHeadersPatterns());
 filteredHeaders.names().forEach(
   headerName -> filteredHeaders.getAll(headerName)
     .forEach(value -> request.headers().add(headerName, value)));
 if (customHttpHeader != null) {
  request.headers().set(
    customHttpHeader.getName(),
    customHttpHeader.getValue()
  );
 }
}

代码示例来源:origin: Cognifide/knotx

private void testPostRequest(VertxTestContext context, Vertx vertx, String url,
  Consumer<HttpResponse<Buffer>> expectedResponse) {
 WebClient client = WebClient.create(vertx);
 MultiMap formData = MultiMap.caseInsensitiveMultiMap();
 formData.add("a", "b");
 Single<HttpResponse<Buffer>> httpResponseSingle = client
   .post(KnotxServerRoutingTest.KNOTX_SERVER_PORT,
     KnotxServerRoutingTest.KNOTX_SERVER_ADDRESS,
     url)
   .rxSendForm(formData);
 subscribeToResult_shouldSucceed(context, httpResponseSingle, expectedResponse);
}

相关文章