From 0faee92e0ae81a760e845f82ecc3b8e8e4d2fe7d Mon Sep 17 00:00:00 2001 From: Spencer Gibb Date: Wed, 8 Mar 2017 19:32:19 -0700 Subject: [PATCH] Add method route predicate docs See gh-24 --- .../main/asciidoc/spring-cloud-gateway.adoc | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/docs/src/main/asciidoc/spring-cloud-gateway.adoc b/docs/src/main/asciidoc/spring-cloud-gateway.adoc index 5449162f..85e37d24 100644 --- a/docs/src/main/asciidoc/spring-cloud-gateway.adoc +++ b/docs/src/main/asciidoc/spring-cloud-gateway.adoc @@ -30,7 +30,7 @@ TODO: give an overview of how the gateway works with maybe a ascii diagram == Route Predicates -Spring Cloud Gateway matches routes as part of the Spring WebFlux `HandlerMapping` infrastructure. Spring Cloud Gateway includes many built-in Route Predicates. All of these predicates match on different attributes of the HTTP request. +Spring Cloud Gateway matches routes as part of the Spring WebFlux `HandlerMapping` infrastructure. Spring Cloud Gateway includes many built-in Route Predicates. All of these predicates match on different attributes of the HTTP request. Multiple Route Predicates can be combined and are combined via logical `and`. === After Route Predicate TODO: document After Route Predicate @@ -80,7 +80,7 @@ spring: This route matches if the request has a header named `X-Request-Id` whos value matches the `\d+` regular expression (has a value of one or more digits). === Host Route Predicate -The Host Route Predicate takes one parameters: the host name pattern. The pattern is an Ant style pattern with `.` as the separator. This predicates matches the `Host` header that matches the patter. +The Host Route Predicate takes one parameter: the host name pattern. The pattern is an Ant style pattern with `.` as the separator. This predicates matches the `Host` header that matches the pattern. .application.yml [source,yaml] @@ -100,7 +100,23 @@ This route would match if the request has a `Host` header has the value `www.som === Method Route Predicate -TODO: document Method Route Predicate +The Method Route Predicate takes one parameter: the HTTP method to match. + +.application.yml +[source,yaml] +---- +spring: + cloud: + gateway: + routes: + # ===================================== + - id: host_route + uri: http://example.org + predicates: + - Method=GET +---- + +This route would match if the request method was a `GET`. === Path Route Predicate TODO: document Path Route Predicate