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

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

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

MultiMap.add介绍

暂无

代码示例

代码示例来源:origin: org.commonjava.vertx/vabr-api

public Respond headers( final Map<String, String> headers )
{
  this.headers.add( headers );
  return this;
}

代码示例来源:origin: org.commonjava.vertx/vabr-api

public Respond header( final String key, final String value )
{
  this.headers.add( key, value );
  return this;
}

代码示例来源:origin: org.commonjava.vertx/vabr-api

public Respond created( final String...pathParts )
{
  this.status = ApplicationStatus.CREATED;
  logger.debug( "Creating Location header with pathParts: {}", new Object()
  {
    @Override
    public String toString()
    {
      return StringUtils.join( pathParts, ", " );
    }
  } );
  final String location = UrlUtils.buildUrl( pathParts );
  logger.debug( "Location: {}", location );
  headers.add( ApplicationHeader.location.key(), location );
  return this;
}

代码示例来源:origin: org.commonjava.vertx/vabr-api

public static Query from( final HttpServerRequest request )
{
  final MultiMap map = new CaseInsensitiveMultiMap();
  final String query = request.query();
  if ( query != null )
  {
    final String[] qe = query.split( "&" );
    for ( final String entry : qe )
    {
      final int idx = entry.indexOf( '=' );
      if ( idx > 1 )
      {
        map.add( entry.substring( 0, idx ), entry.substring( idx + 1 ) );
      }
      else
      {
        map.add( entry, "true" );
      }
    }
  }
  return new Query( map );
}

代码示例来源:origin: OlivierCroisier/LP4J

private void setResponseContentType(HttpServerResponse response, String resourcePath) {
  String contentType = findContentType(resourcePath);
  response.headers().add("Content-Type", contentType);
}

代码示例来源:origin: OlivierCroisier/LP4J

private void redirectToIndexHtml(HttpServerResponse response) {
  response.headers().add("Location", WEB_RESOURCES_PREFIX + "/index.html");
  response.setStatusCode(301).end();
}

代码示例来源:origin: org.commonjava.vertx/vabr-api

params.add( BuiltInParam._routeBase.key(), routeBase );
  params.add( BuiltInParam._routeContextUrl.key(), routeContextUrl );
    params.add( BuiltInParam._classBase.key(), classBase );
    params.add( BuiltInParam._classContextUrl.key(), classContext );
    params.add( BuiltInParam._classBase.key(), classBase );
    params.add( BuiltInParam._classContextUrl.key(), classContext );
      params.add( param, v );
    params.add( "param" + i, v );
for ( final String name : paramNames )
  params.add( "q:" + name, query.getAll( name ) );
    .add( params );

代码示例来源:origin: com.github.flowersinthesand/portal-vertx

@Override
  public void handle(HttpServerRequest req) {
    req.response().headers().add(AbstractSocketFactory.noCacheHeader()).add(AbstractSocketFactory.corsHeader(req.headers().get("Origin")));
    String when = req.params().get("when");
    if (when.equals("open") || when.equals("poll")) {
      socketFactory.openHttp(req);
    } else if (when.equals("abort")) {
      socketFactory.abort(req.params().get("id"));
    }
  }
};

代码示例来源:origin: com.github.flowersinthesand/portal-vertx

@Override
  public void handle(HttpServerRequest req) {
    req.response().headers().add(AbstractSocketFactory.noCacheHeader()).add(AbstractSocketFactory.corsHeader(req.headers().get("Origin")));
    req.bodyHandler(new Handler<Buffer>() {
      @Override
      public void handle(Buffer body) {
        socketFactory.fire(body.toString().substring("data=".length()));
      };
    });
    req.response().end();
  }
};

代码示例来源:origin: com.englishtown/vertx-mod-jersey

/**
 * {@inheritDoc}
 */
@Override
public void close() throws IOException {
  // Write any remaining buffer to the vert.x response
  // Set content-length if not set yet
  if (buffer != null && buffer.length() > 0) {
    if (!response.headers().contains(HttpHeaders.CONTENT_LENGTH)) {
      response.headers().add(HttpHeaders.CONTENT_LENGTH, String.valueOf(buffer.length()));
    }
    response.write(buffer);
  }
  buffer = null;
  isClosed = true;
}

代码示例来源:origin: org.commonjava.aprox/aprox-subsys-vertx

@FilterRoute( path = "/(?!.*(login|logout)).*", method = Method.ANY )
public void setUser( final HttpServerRequest request, final ExecutionChain chain )
  throws Exception
{
  // FIXME: Need a proper login!
  String user = request.headers()
             .get( ApplicationHeader.x_forwarded_for.key() );
  if ( user == null )
  {
    user = request.remoteAddress()
           .getHostString();
  }
  request.params()
      .add( SecurityParam.user.key(), user );
  chain.handle();
}

代码示例来源:origin: org.commonjava.vertx/vabr-api

.add( RouteHeader.recommended_content_type.header(), info.getRawAccept() );
  .add( RouteHeader.base_accept.header(), info.getBaseAccept() );
.add( RouteHeader.recommended_content_version.header(), version );

代码示例来源:origin: com.englishtown/vertx-mod-jersey

if (!mediaType.getParameters().isEmpty()) {
  vertxRequest.headers().remove(HttpHeaders.CONTENT_TYPE);
  vertxRequest.headers().add(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED);

相关文章