Finds the {@code Info} instance that matches {@code httpMethod} and {@code url}.

@param httpMethod the method of a HTTP request
@param url the url of a HTTP request
@return an {@code Info} corresponding to the url and method, or null if none is found
976079
public @Nullable Info lookup(String httpMethod, String url) {
    httpMethod = httpMethod.toLowerCase();
    if (url.startsWith("/")) {
      url = url.substring(1);
    }
    url = StringUtils.stripTrailingSlash(url);
    List<Info> infos = infosByHttpMethod.get(httpMethod);
    if (infos == null) {
      log.atFine().log(
          "no information about any urls for HTTP method %s when checking %s", httpMethod, url);
      return null;
    }
    for (Info info : infos) {
      log.atFine().log("trying %s with template %s", url, info.getTemplate());
      if (info.getTemplate().matches(url)) {
        log.atFine().log("%s matched %s", url, info.getTemplate());
        return info;
      } else {
        log.atFine().log("%s did not matched %s", url, info.getTemplate());
      }
    }

    return null;
  }
1218990
public JavaMethod getMethod(String name)
  {
    ArrayList<JavaMethod> methodList = getMethodList();
    
    for (int i = 0; i < methodList.size(); i++) {
      JavaMethod method = methodList.get(i);

      if (method.getName().equals(name))
        return method;
    }

    return null;
  }
471769
@Nullable
  private HttpMethodInfo prepareHandleMethod(HttpRequest httpRequest,
                                             HttpResponder responder, ChannelHandlerContext ctx) throws Exception {
    HttpMethodInfo methodInfo = httpMethodHandler.getDestinationMethod(httpRequest, responder);

    if (methodInfo == null) {
      return null;
    }

    ctx.channel().attr(HttpDispatcher.METHOD_INFO_KEY).set(methodInfo);

    ChannelPipeline pipeline = ctx.channel().pipeline();
    if (methodInfo.isStreaming()) {
      if (pipeline.get("aggregator") != null) {
        pipeline.remove("aggregator");
      }
      if (pipeline.get("continue") == null) {
        pipeline.addAfter("router", "continue", new HttpServerExpectContinueHandler());
      }
    } else {
      if (pipeline.get("continue") != null) {
        pipeline.remove("continue");
      }
      if (pipeline.get("aggregator") == null) {
        pipeline.addAfter("router", "aggregator", new HttpObjectAggregator(chunkMemoryLimit));
      }
    }
    return methodInfo;
  }
1331903
public static MatchResult doMatch(final String requestURI, final String httpMethod) {
        MatchResult ret;
        final int segs = StringUtils.countMatches(requestURI, "/");
        ContextHandlerMeta contextHandlerMeta;
        String concreteKey = httpMethod + "." + requestURI;
        switch (segs) {
            case 1:
                contextHandlerMeta = ONE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, ONE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, ONE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, ONE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, ONE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, ONE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            case 2:
                contextHandlerMeta = TWO_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, TWO_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, TWO_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, TWO_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, TWO_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, TWO_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            case 3:
                contextHandlerMeta = THREE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, THREE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, THREE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, THREE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, THREE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, THREE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
            default:
                contextHandlerMeta = FOUR_MORE_SEG_CONCRETE_CTX_HANDLER_METAS.get(concreteKey);
                if (null != contextHandlerMeta) {
                    return new MatchResult(contextHandlerMeta, requestURI, httpMethod, requestURI);
                }

                switch (httpMethod) {
                    case "GET":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_GET_VAR_CTX_HANDLER_METAS);
                    case "POST":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_POST_VAR_CTX_HANDLER_METAS);
                    case "PUT":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_PUT_VAR_CTX_HANDLER_METAS);
                    case "DELETE":
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_DELETE_VAR_CTX_HANDLER_METAS);
                    default:
                        return route(requestURI, httpMethod, FOUR_MORE_SEG_OTHER_METHOD_VAR_CTX_HANDLER_METAS);
                }
        }
    }
783053
public Request makeRequest(HttpMethod httpMethod, String urlPath) throws IOException
  {
    return makeRequest(httpMethod, urlPath, true);
  }
1333987
public static String getHttpMethod(Span span) {
        if (isHttp(span)) {
            BinaryAnnotation ba = span.getBinaryAnnotation("http.method");
            String httpMethod = null;
            if (ba != null) {
                httpMethod = ba.getValue().toUpperCase();
            } else if (span.getName() != null) {
                httpMethod = span.getName().toUpperCase();
            }

            if (HTTP_METHODS.contains(httpMethod)) {
                return httpMethod;
            }
        }

        return null;
    }
435972
@Nullable
  public static EHttpMethod getHttpMethod (@Nonnull final HttpServletRequest aHttpRequest)
  {
    ValueEnforcer.notNull (aHttpRequest, "HttpRequest");

    final String sMethod = aHttpRequest.getMethod ();
    return EHttpMethod.getFromNameOrNull (sMethod);
  }
532806
public HttpConnection setMethod(Method method) {
		// method
		try {
			this.conn.setRequestMethod(method.toString());
		} catch (ProtocolException e) {
			throw new HttpException(e);
		}

		// do input and output
		this.conn.setDoInput(true);
		if (Method.POST.equals(method) //
				|| Method.PUT.equals(method)//
				|| Method.PATCH.equals(method)//
				|| Method.DELETE.equals(method)) {
			this.conn.setDoOutput(true);
			this.conn.setUseCaches(false);
		}
		return this;
	}
974209
@SneakyThrows
    public BaseHttpServletRequestXMLMessageDecoder getInstance(final HttpMethod method) {
        val decoder = get(method);
        return (BaseHttpServletRequestXMLMessageDecoder) BeanUtils.cloneBean(decoder);
    }
1162926
private HttpPost preparePost(final String url) {
    final HttpPost httpPost = new HttpPost(this.instanceUrl + url);
    for (final Header header : this.headers) {
      httpPost.addHeader(header);
    }
    return httpPost;
  }
937522
public boolean matches(HttpMethod httpMethod, String requestUri) {
        if (this.httpMethod == httpMethod) {
            return matches(requestUri);
        }
        return false;
    }
762236
protected HttpUriRequest createHttpUriRequest(HttpMethod httpMethod, URI uri) {
		switch (httpMethod) {
		case GET:
			return new HttpGetHC4(uri);
		case DELETE:
			return new HttpDeleteHC4(uri);
		case HEAD:
			return new HttpHeadHC4(uri);
		case OPTIONS:
			return new HttpOptionsHC4(uri);
		case POST:
			return new HttpPostHC4(uri);
		case PUT:
			return new HttpPutHC4(uri);
		case TRACE:
			return new HttpTraceHC4(uri);
		case PATCH:
			return new HttpPatch(uri);
		default:
			throw new IllegalArgumentException("Invalid HTTP method: " + httpMethod);
		}
	}
928314
public RequestBuilder request(String method, URL url) {
        try {
            RequestBuilder req = new RequestBuilder();
            req.host = url.getHost();
            req.port = url.getPort() < 0 ? url.getDefaultPort() : url.getPort();
            HttpURI httpURI = new HttpURI(url.toURI());
            if (!StringUtils.hasText(httpURI.getPath().trim())) {
                httpURI.setPath("/");
            }
            req.request = new MetaData.Request(method, httpURI, HttpVersion.HTTP_1_1, new HttpFields());
            return req;
        } catch (URISyntaxException e) {
            log.error("url exception", e);
            throw new IllegalArgumentException(e);
        }
    }
1367510
public List<ValidationData> findByMethodAndUrl(String method, String url) {
        return this.methodAndUrlIndex.get(ValidationIndexUtil.makeKey(method, url));
    }
992084
def get_http_method(self, method):
        """"""
        return self.http_methods[method](self.url, **self.http_method_args)
1251018
public static HttpResponse execute(final String url, final String method) {
        return execute(url, method, null, null, new HashMap<>(), new HashMap<>());
    }
474482
protected boolean isHttpMethodMatch(String method) {
		if(StrUtil.isNotBlank(httpMethod) && httpMethod.equalsIgnoreCase(method) == false) {
			if(HuluSetting.isDevMode) {
				StaticLog.warn("Request [{}] method [{}] is not match [{}]", requestPath, method, httpMethod);
			}
			return false;
		}
		return true;
	}