HTTP method matching

Specify an HTTP method, such as POST, GET, PUT, PATCH, or DELETE, to match requests against. For other methods of request matching, see Match incoming requests.

Configuration

In a RouteTable resource, add the following matchers section to your route:

...
  http:
  - matchers:
    - method: <HTTP_method>
    ...

For more information, see the Gloo Mesh API docs for route tables and for request matching.

Examples

In this example, the ingress gateway forwards all PATCH requests to the myapp destination.

apiVersion: networking.gloo.solo.io/v2
kind: RouteTable
metadata:
  name: http-method-match
  namespace: global
spec:
  hosts:
    - 'one.solo.io'
  virtualGateways:
    - name: ingress-gateway
      namespace: gloo-mesh
      cluster: ${REMOTE_CLUSTER1}
  http:
  - matchers:
    - method: PATCH
    forwardTo:
      destinations:
      - ref:
          name: myapp
          namespace: global
          cluster: ${REMOTE_CLUSTER1}
        port:
          number: 8090
        kind: SERVICE

Next steps

Check out the guides in Forward requests to a destination to further build your route tables based on the destination type, and apply the route tables to your ingress gateway.