org.vertx.java.core.MultiMap.set()方法的使用及代码示例

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

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

MultiMap.set介绍

暂无

代码示例

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

@Override
public Value offsetSet(Value name, Value value) {
 map.set(name.toString(), value.toString());
 return null;
}

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

@Override
  public void handle(HttpClientResponse clientResponse) {
    delegate.handle(clientResponse);

    MultiMap headers = clientResponse.headers();
    for (String headerName : rewriteHeaders) {
      List<String> headerValues = headers.getAll(headerName);
      int size = headerValues.size();
      if (size > 0) {
        List<String> newHeaders = new ArrayList<String>(size);
        for (String headerValue : headerValues) {
          String newValue = headerValue;
          if (headerValue != null && headerValue.length() > 0) {
            newValue = proxyMappingDetails.rewriteBackendUrl(headerValue);
          }
        }
        LOG.info("Rewriting header " + headerName + " from: " + headerValues + " to: " + newHeaders);
        headers.set(headerName, newHeaders);
      }
    }
  }
}

代码示例来源:origin: jboss-fuse/fabric8

@Override
  public void handle(HttpClientResponse clientResponse) {
    delegate.handle(clientResponse);

    MultiMap headers = clientResponse.headers();
    for (String headerName : rewriteHeaders) {
      List<String> headerValues = headers.getAll(headerName);
      int size = headerValues.size();
      if (size > 0) {
        List<String> newHeaders = new ArrayList<String>(size);
        for (String headerValue : headerValues) {
          String newValue = headerValue;
          if (headerValue != null && headerValue.length() > 0) {
            newValue = proxyMappingDetails.rewriteBackendUrl(headerValue);
          }
        }
        LOG.info("Rewriting header " + headerName + " from: " + headerValues + " to: " + newHeaders);
        headers.set(headerName, newHeaders);
      }
    }
  }
}

代码示例来源:origin: jboss-fuse/fabric8

protected void doReturnIndex(HttpServerRequest request, Map<String, MappedServices> mappingRules) throws IOException {
  String json = mappingRulesToJson(mappingRules);
  HttpServerResponse response = request.response();
  response.headers().set(CONTENT_TYPE, "application/json");
  if ("HEAD".equals(request.method())) {
    // For HEAD method you must not return message body but must send 'Content-Length' header
    // https://www.w3.org/Protocols/rfc2616/rfc2616-sec9.html#sec9.4
    String contentLength = String.valueOf(new Buffer(json).length());
    response.putHeader(CONTENT_LENGTH, contentLength)
        .end();
  } else {
    response.end(json);
  }
  response.setStatusCode(200);
}

代码示例来源:origin: io.fabric8/gateway-apiman

httpRequest.headers().set(serviceRequest.getHeaders());
final HttpClientRequest vxServiceClientRequest = httpGatewayClient.execute(httpRequest, handler);

代码示例来源:origin: jboss-fuse/fabric8

clientRequest.headers().set(request.headers());
clientRequest.setChunked(true);
clientRequest.exceptionHandler(new Handler<Throwable>() {

代码示例来源:origin: jboss-fuse/fabric8

public void handle(HttpClientResponse clientResponse) {
    LOG.debug("Proxying response: {}", clientResponse.statusCode());
    request.response().setStatusCode(clientResponse.statusCode());
    request.response().headers().set(clientResponse.headers());
    applyChunkedEncoding(request.response());
    clientResponse.dataHandler(new Handler<Buffer>() {
      public void handle(Buffer data) {
        LOG.debug("Proxying response body: {}", data);
        request.response().write(data);
      }
    });
    clientResponse.endHandler(new VoidHandler() {
      public void handle() {
        request.response().end();
        finalClient.close();
      }
    });
  }
};

代码示例来源:origin: io.fabric8/gateway-apiman

SystemResource systemResource = new SystemResource(engine);
String json = getObjectMapper().writeValueAsString(systemResource.getStatus());
request.response().headers().set("ContentType", "application/json");
request.response().headers().set("Content-Length", String.valueOf(json.length()));
request.response().write(json);
request.response().setStatusCode(200);

相关文章