The Method Route Predicate Factory

The Method Route Predicate Factory takes one or more parameters: the HTTP methods to match. The following example configures a method route predicate:

Example 1. application.yml
spring:
  cloud:
    gateway:
      routes:
      - id: method_route
        uri: https://example.org
        predicates:
        - Method=GET,POST

This route matches if the request method was a GET or a POST.