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 Gateway API docs for route tables and for request matching.

Examples

In this example, the 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: istio-ingressgateway
      namespace: bookinfo
      cluster: ${CLUSTER_NAME}
  http:
  - matchers:
    - method: PATCH
    forwardTo:
      destinations:
      - ref:
          name: myapp
          namespace: global
          cluster: ${CLUSTER_NAME}
        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.