For example, if you specify an HTTP method in a route table for service B, a request from service A in your mesh to service B must use that HTTP method in order for the request to be routed. 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:
    - 'myapp.global.svc.cluster.local'
  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.