Specifies the list of allowed HTTP methods (GET, POST, etc). This is provided in an <code>Allow</code> header, as required by the HTTP specification (RFC 2616).
777951
public void setAllowedMethods(RequestTypeEnum... theAllowedMethods) {
		if (theAllowedMethods == null || theAllowedMethods.length == 0) {
			myAllowedMethods = null;
		} else {
			myAllowedMethods = new LinkedHashSet<RequestTypeEnum>();
			for (RequestTypeEnum next : theAllowedMethods) {
				myAllowedMethods.add(next);
			}
		}
		updateAllowHeader();
	}
309139
public boolean isMethodAllowed(String method) {

		return HttpMethod.isValidMethod(method) && (allowedMethods.isEmpty() || allowedMethods.contains(method));
	}
1234017
function method (request) {

    if (request.emulateHTTP && /^(PUT|PATCH|DELETE)$/i.test(request.method)) {
        request.headers.set('X-HTTP-Method-Override', request.method);
        request.method = 'POST';
    }

}
47615
def check_method_allowed(cls, request):
        
        if not request.method in cls._meta.allowed_methods:
            raise HttpError(
                'Method \'%s\' not allowed on this resource.' % request.method,
                status=status.HTTP_405_METHOD_NOT_ALLOWED)
1357956
private static String[] getAllowedMethods(String[] existingMethods) {
        int listCapacity = existingMethods.length + 1;

        List<String> allowedMethods = new ArrayList<>(listCapacity);

        allowedMethods.addAll(Arrays.asList(existingMethods));
        allowedMethods.add(METHOD_PATCH);

        return allowedMethods.toArray(new String[0]);
    }
233804
def http_methods(self, urls=None, **route_data):
        """"""
        def decorator(class_definition):
            instance = class_definition
            if isinstance(class_definition, type):
                instance = class_definition()

            router = self.urls(urls if urls else "/{0}".format(instance.__class__.__name__.lower()), **route_data)
            for method in HTTP_METHODS:
                handler = getattr(instance, method.lower(), None)
                if handler:
                    http_routes = getattr(handler, '_hug_http_routes', ())
                    if http_routes:
                        for route in http_routes:
                            http(**router.accept(method).where(**route).route)(handler)
                    else:
                        http(**router.accept(method).route)(handler)

                    cli_routes = getattr(handler, '_hug_cli_routes', ())
                    if cli_routes:
                        for route in cli_routes:
                            cli(**self.where(**route).route)(handler)
            return class_definition
        return decorator
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;
	}
1124276
public void withHttpMethod(Http method) {
        Objects.requireNonNull(method, Required.METHOD.toString());
        this.method = method;
    }
1009230
private static HttpResponse ensureRequestSet(HttpResponse httpResponse) {
        Objects.requireNonNull(httpResponse.request());
        Objects.requireNonNull(httpResponse.request().httpMethod());
        return httpResponse;
    }
514326
private void processRequestHeaderOverrides(HttpMethod httpMethodProxyRequest) throws Exception {
        RequestInformation requestInfo = requestInformation.get();
        for (EndpointOverride selectedPath : requestInfo.selectedRequestPaths) {
            List<EnabledEndpoint> points = selectedPath.getEnabledEndpoints();
            for (EnabledEndpoint endpoint : points) {
                if (endpoint.getOverrideId() == Constants.PLUGIN_REQUEST_HEADER_OVERRIDE_ADD) {
                    httpMethodProxyRequest.addRequestHeader(endpoint.getArguments()[0].toString(),
                                                            endpoint.getArguments()[1].toString());
                    requestInfo.modified = true;
                } else if (endpoint.getOverrideId() == Constants.PLUGIN_REQUEST_HEADER_OVERRIDE_REMOVE) {
                    httpMethodProxyRequest.removeRequestHeader(endpoint.getArguments()[0].toString());
                    requestInfo.modified = true;
                }
            }
        }
    }
828685
public Set<HttpMethod> getAllow() {
		String value = getFirst(ALLOW);
		if (!StringUtils.isEmpty(value)) {
			List<HttpMethod> allowedMethod = new ArrayList<HttpMethod>(5);
			String[] tokens = value.split(",\\s*");
			for (String token : tokens) {
				allowedMethod.add(HttpMethod.valueOf(token));
			}
			return EnumSet.copyOf(allowedMethod);
		}
		else {
			return EnumSet.noneOf(HttpMethod.class);
		}
	}
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);
		}
	}
344804
function allowedMethods(methods) {
  // default values
  var methodsAllowed = { 'GET': true, 'POST': false, 'PUT': false, 'HEAD': false, 'DELETE': false  };
  // check and override if one of the default methods
  for (var key in methods) {
    var newKey = key.toUpperCase();
    if ( methodsAllowed[newKey]!=undefined) {
      methodsAllowed[newKey] = Boolean(methods[key]);
    }
  }
  return methodsAllowed;
}
1332881
def request(cls, method, url, **kwargs):
		
		methodupper = method.upper()
		hasdata = 'data' in kwargs
		if methodupper == 'GET':
			if hasdata:
				print("ERROR: Can't do HTTP GET when the 'data' parameter presents")
				assert False
			resp = ulr.urlopen(url, **kwargs)
		elif methodupper == 'POST':
			if hasdata:
				resp = ulr.urlopen(url, **kwargs)
			else:
				resp = ulr.urlopen(url, data = '', **kwargs)
		else:
			raise NotImplementedError()

		return resp
865069
private String checkRequestMethod(HttpServletRequest request, JCorsConfig config) {

		String requestMethod = request.getHeader(CorsHeaders.ACCESS_CONTROL_REQUEST_METHOD_HEADER);
		Constraint.ensureNotEmpty(requestMethod, "Request Method Header must be supplied");

		Constraint.ensureTrue(config.isMethodAllowed(requestMethod),
				String.format("The specified method is not allowed: '%s'", requestMethod));

		return requestMethod;
	}
627306
protected static function allowHeaders()
    {
        if (self::$needHeaders !== null) {
            return self::$needHeaders;
        }

        return self::$needHeaders = Request::is('GET') || Request::is('HEAD');
    }
726122
public Collection<String> getAllowedMethods(String requestMethod) {

		Constraint.ensureNotEmpty(requestMethod, String.format("Invalid method '%s'", requestMethod));
		Set<String> rtAllowedMethods = new HashSet<String>(allowedMethods);
		rtAllowedMethods.add(requestMethod.toUpperCase());

		return rtAllowedMethods;
	}