gpt4 book ai didi

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

转载 作者:知者 更新时间:2024-03-15 11:50:40 28 4
gpt4 key购买 nike

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

YokeRequest.method介绍

暂无

代码示例

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

@Override
public String getRequestMethod() {
  return request.method().name();
}

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

private boolean isPreflightRequest(final YokeRequest request)
{
  return OPTIONS.name().equals(request.method())
      && (request.getHeader(ACCESS_CONTROL_REQUEST_HEADERS) != null || request.getHeader(ACCESS_CONTROL_REQUEST_METHOD) != null);
}

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

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  String token = request.get(key);
  // generate CSRF token
  if (token == null) {
    token = UUID.randomUUID().toString();
    request.put(key, token);
  }
  // ignore these methods
  if (HttpMethod.GET.equals(request.method()) || HttpMethod.HEAD.equals(request.method()) || HttpMethod.OPTIONS.equals(request.method())) {
    next.handle(null);
    return;
  }
  // expect multipart
  request.setExpectMultipart(true);
  // determine value
  String val = valueHandler.handle(request);
  // check
  if (!token.equals(val)) {
    next.handle(403);
    return;
  }
  // OK
  next.handle(null);
}

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

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  if (!HttpMethod.GET.equals(request.method()) && !HttpMethod.HEAD.equals(request.method())) {
    next.handle(null);
  } else {

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

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  final HttpMethod method = request.method();
  final YokeResponse response = request.response();

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

if (HttpMethod.GET != request.method() && HttpMethod.HEAD != request.method() && HttpMethod.OPTIONS != request.method()) {

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

@Override
  public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {

    // common logging data
    final long timestamp = System.currentTimeMillis();
    final String remoteClient = getClientAddress(request.remoteAddress());
    final HttpMethod method = request.method();
    final String uri = request.uri();
    final String version = getVersionString(request.version());

    if (immediate) {
      log(request, timestamp, remoteClient, version, method.name(), uri);
    } else {
      request.response().endHandler(new Handler<Void>() {
        @Override
        public void handle(Void event) {
          log(request, timestamp, remoteClient, version, method.name(), uri);
        }
      });
    }

    next.handle(null);
  }
}

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

final HttpMethod method = request.method();

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

String token = null;
if (HttpMethod.OPTIONS.equals(request.method()) && request.getHeader("access-control-request-headers") != null) {
  for (String ctrlReq : request.getHeader("access-control-request-headers").split(",")) {
    if (ctrlReq.contains("authorization")) {

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

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  if (request.path().equals(loginURI)) {
    if (HttpMethod.GET.equals(request.method())) {
      if (loginTemplate != null) {
    if (HttpMethod.POST.equals(request.method())) {
      if (forceSSL && !request.isSSL()) {
    if (HttpMethod.GET.equals(request.method())) {

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

@Override
public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
  switch (request.method()) {
    case GET:
      route(request, next, getBindings);

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

final HttpClient client = vertx().createHttpClient(new HttpClientOptions().setDefaultHost(host).setDefaultPort(port).setSsl(secure));
final HttpClientRequest cReq = client.request(req.method(), newUri, new Handler<HttpClientResponse>() {
 public void handle(HttpClientResponse cRes) {
  req.response().setStatusCode(cRes.statusCode());

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

/**
 * Write a file into the response body
 *
 * @param request
 * @param file
 * @param props
 */
private void sendFile(final YokeRequest request, final String file, final FileProps props) {
  // write content type
  String contentType = MimeType.getMime(file);
  String charset = MimeType.getCharset(contentType);
  request.response().setContentType(contentType, charset);
  request.response().putHeader("Content-Length", Long.toString(props.size()));
  // head support
  if (HttpMethod.HEAD.equals(request.method())) {
    request.response().end();
  } else {
    request.response().sendFile(file);
  }
}

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