gpt4 book ai didi

com.jetdrone.vertx.yoke.middleware.YokeRequest.params()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-15 13:06:40 29 4
gpt4 key购买 nike

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

YokeRequest.params介绍

暂无

代码示例

代码示例来源:origin: pmlopes/yoke

/** Allow getting parameters in a generified way.
 *
 * @param name The key to get
 * @return {List} The found object
 */
public List<String> getParameterList(@NotNull final String name) {
  return params().getAll(name);
}

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
    if (!regex.matcher(request.params().get(paramName)).matches()) {
      // Bad Request
      next.handle(400);
      return;
    }
    next.handle(null);
  }
});

代码示例来源:origin: pmlopes/yoke

@Override
public Map<String, String[]> getRequestParameters() {
  final Map<String, String[]> map = new HashMap<>();
  if (request.params().get("pac4jFormAttributes") != null) {
    for (String name : request.formAttributes().names()) {
      map.put(name, request.formAttributes().getAll(name).toArray(new String[0]));
    }
  }
  for (String name : request.params().names()) {
    map.put(name, request.params().getAll(name).toArray(new String[0]));
  }
  return map;
}

代码示例来源:origin: pmlopes/yoke

@Override
public String getRequestParameter(String name) {
  String param = request.params().get(name);
  if (param == null & request.params().get("pac4jFormAttributes") != null) {
    param = request.formAttributes().get(name);
    if (param != null) {
      // FIX for Vert.x
      param = param.replaceAll("\\s", "+");
    }
  }
  return param;
}

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
    // get the real id from the params multimap
    final String id = request.params().get(idName);
    store.delete(idName, id, new AsyncResultHandler<Number>() {
      @Override
      public void handle(AsyncResult<Number> event) {
        if (event.failed()) {
          next.handle(event.cause());
          return;
        }
        if (event.result().intValue() == 0) {
          next.handle(404);
        } else {
          request.response().setStatusCode(204);
          request.response().end();
        }
      }
    });
  }
};

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
    JsonObject item = request.body();
    if (item == null) {
      next.handle("Body must be JSON");
      return;
    }
    // get the real id from the params multimap
    String id = request.params().get(idName);
    store.update(idName, id, item, new AsyncResultHandler<Number>() {
      @Override
      public void handle(AsyncResult<Number> event) {
        if (event.failed()) {
          next.handle(event.cause());
          return;
        }
        if (event.result().intValue() == 0) {
          // nothing was updated
          next.handle(404);
        } else {
          request.response().setStatusCode(204);
          request.response().end();
        }
      }
    });
  }
};

代码示例来源:origin: pmlopes/yoke

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
    // content negotiation
    if (request.accepts("application/json") == null) {
      // Not Acceptable (we only talk json)
      next.handle(406);
      return;
    }
    // get the real id from the params multimap
    String id = request.params().get(idName);
    store.read(idName, id, new AsyncResultHandler<JsonObject>() {
      @Override
      public void handle(AsyncResult<JsonObject> event) {
        if (event.failed()) {
          next.handle(event.cause());
          return;
        }
        if (event.result() == null) {
          // does not exist, returns 404
          next.handle(404);
        } else {
          request.response().end(event.result());
        }
      }
    });
  }
};

代码示例来源:origin: pmlopes/yoke

final String id = request.params().get(key);

代码示例来源:origin: pmlopes/yoke

for (Map.Entry<String, String> entry : request.params()) {
  String[] sortArgs;

代码示例来源:origin: pmlopes/yoke

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  final String id = request.params().get(idName);

代码示例来源:origin: pmlopes/yoke

for (Map.Entry<String, String> entry : request.params()) {
  String[] sortArgs;

代码示例来源:origin: pmlopes/yoke

String id = request.params().get(key);

代码示例来源:origin: pmlopes/yoke

final String id = request.params().get(key);

代码示例来源:origin: pmlopes/yoke

final String id = request.params().get(key);

代码示例来源:origin: pmlopes/yoke

final MultiMap params = request.params();

代码示例来源:origin: pmlopes/yoke

@Override
  public String handle(YokeRequest request) {
    String token = request.formAttributes().get(key);
    if (token == null) {
      token = request.params().get(key);
      if (token == null) {
        token = request.headers().get("x-csrf-token");
      }
    }
    return token;
  }
};

代码示例来源:origin: pmlopes/yoke

public HtmlFileTransport(Vertx vertx, Router router, LocalMap<String, SockJSSession> sessions, SockJSHandlerOptions options,
         Handler<SockJSSocket> sockHandler) {
 super(vertx, sessions, options);
 String htmlFileRE = COMMON_PATH_ELEMENT_RE + "htmlfile.*";
 router.get(Pattern.compile(htmlFileRE), (request, next) -> {
  if (log.isTraceEnabled()) log.trace("HtmlFile, get: " + request.uri());
  String callback = request.getParam("callback");
  if (callback == null) {
   callback = request.getParam("c");
   if (callback == null) {
    request.response().setStatusCode(500).end("\"callback\" parameter required\n");
    return;
   }
  }
  String sessionID = request.params().get("param0");
  SockJSSession session = getSession(request, options.getSessionTimeout(), options.getHeartbeatInterval(), sessionID, sockHandler);
  session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());
  session.register(new HtmlFileListener(options.getMaxBytesStreaming(), request, callback, session));
 });
}

代码示例来源:origin: pmlopes/yoke

String sessionID = request.params().get("param0");
SockJSSession session = getSession(request, options.getSessionTimeout(), options.getHeartbeatInterval(), sessionID, sockHandler);
session.setInfo(request.localAddress(), request.remoteAddress(), request.uri(), request.headers());

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com