Skip to content
v2.274.0

HttpRouteMethod Enum ​

Supported values for matching routes based on the HTTP request method.

Example ​

ts
declare const router: appmesh.VirtualRouter;
declare const node: appmesh.VirtualNode;

router.addRoute('route-http2', {
  routeSpec: appmesh.RouteSpec.http2({
    weightedTargets: [
      {
        virtualNode: node,
      },
    ],
    match: {
      path: appmesh.HttpRoutePathMatch.exactly('/exact'),
      method: appmesh.HttpRouteMethod.POST,
      protocol: appmesh.HttpRouteProtocol.HTTPS,
      headers: [
        // All specified headers must match for the route to match.
        appmesh.HeaderMatch.valueIs('Content-Type', 'application/json'),
        appmesh.HeaderMatch.valueIsNot('Content-Type', 'application/json'),
      ],
      queryParameters: [
        // All specified query parameters must match for the route to match.
        appmesh.QueryParameterMatch.valueIs('query-field', 'value')
      ],
    },
  }),
});

Members ​

MemberDescription
GETGET request.
HEADHEAD request.
POSTPOST request.
PUTPUT request.
DELETEDELETE request.
CONNECTCONNECT request.
OPTIONSOPTIONS request.
TRACETRACE request.
PATCHPATCH request.

Referenced by ​