You can use predicates in Spring Cloud Gateway to match an incoming request to a route configuration. For example, you can match based on the HTTP Method or URL path of the request.
The open-source Spring Cloud Gateway project includes a number of built-in predicates that can be used in Spring Cloud Gateway for VMware Tanzu.
For a complete list, see the Spring Cloud Gateway OSS documentation.
Predicate | Description |
---|---|
After | matches requests made after a certain datetime |
Before | matches requests made before a certain datetime |
Between | matches requests made between two certain datetimes |
Cookie | matches requests with a certain cookie |
Header | matches requests with a certain header |
Host | matches requests with a certain host pattern |
Method | matches requests to HTTP method (GET/POST) |
Path | matches requests with path of certain pattern(s) |
Query | matches requests with certain query parameter (optional with value pattern) |
RemoteAddr | matches requests of a certain remote IP address |
Weight | Split requests between a set of targets in a group |