Show / Hide Table of Contents

Class HeaderMatch

Used to generate header matching methods.

Inheritance
object
HeaderMatch
Namespace: Amazon.CDK.AWS.AppMesh
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class HeaderMatch : DeputyBase
Syntax (vb)
Public MustInherit Class HeaderMatch Inherits DeputyBase
Remarks

ExampleMetadata: infused

Examples
VirtualRouter router;
            VirtualNode node;


            router.AddRoute("route-http2", new RouteBaseProps {
                RouteSpec = RouteSpec.Http2(new HttpRouteSpecOptions {
                    WeightedTargets = new [] { new WeightedTarget {
                        VirtualNode = node
                    } },
                    Match = new HttpRouteMatch {
                        Path = HttpRoutePathMatch.Exactly("/exact"),
                        Method = HttpRouteMethod.POST,
                        Protocol = HttpRouteProtocol.HTTPS,
                        Headers = new [] { HeaderMatch.ValueIs("Content-Type", "application/json"), HeaderMatch.ValueIsNot("Content-Type", "application/json") },
                        QueryParameters = new [] { QueryParameterMatch.ValueIs("query-field", "value") }
                    }
                })
            });

Synopsis

Constructors

HeaderMatch()

Used to generate header matching methods.

Methods

Bind(Construct)

Returns the header match configuration.

ValueDoesNotEndWith(string, string)

The value of the header with the given name in the request must not end with the specified characters.

ValueDoesNotMatchRegex(string, string)

The value of the header with the given name in the request must not include the specified characters.

ValueDoesNotStartWith(string, string)

The value of the header with the given name in the request must not start with the specified characters.

ValueEndsWith(string, string)

The value of the header with the given name in the request must end with the specified characters.

ValueIs(string, string)

The value of the header with the given name in the request must match the specified value exactly.

ValueIsNot(string, string)

The value of the header with the given name in the request must not match the specified value exactly.

ValueMatchesRegex(string, string)

The value of the header with the given name in the request must include the specified characters.

ValueStartsWith(string, string)

The value of the header with the given name in the request must start with the specified characters.

ValuesIsInRange(string, double, double)

The value of the header with the given name in the request must be in a range of values.

ValuesIsNotInRange(string, double, double)

The value of the header with the given name in the request must not be in a range of values.

Constructors

HeaderMatch()

Used to generate header matching methods.

protected HeaderMatch()
Remarks

ExampleMetadata: infused

Examples
VirtualRouter router;
            VirtualNode node;


            router.AddRoute("route-http2", new RouteBaseProps {
                RouteSpec = RouteSpec.Http2(new HttpRouteSpecOptions {
                    WeightedTargets = new [] { new WeightedTarget {
                        VirtualNode = node
                    } },
                    Match = new HttpRouteMatch {
                        Path = HttpRoutePathMatch.Exactly("/exact"),
                        Method = HttpRouteMethod.POST,
                        Protocol = HttpRouteProtocol.HTTPS,
                        Headers = new [] { HeaderMatch.ValueIs("Content-Type", "application/json"), HeaderMatch.ValueIsNot("Content-Type", "application/json") },
                        QueryParameters = new [] { QueryParameterMatch.ValueIs("query-field", "value") }
                    }
                })
            });

Methods

Bind(Construct)

Returns the header match configuration.

public abstract IHeaderMatchConfig Bind(Construct scope)
Parameters
scope Construct
Returns

IHeaderMatchConfig

Remarks

ExampleMetadata: infused

ValueDoesNotEndWith(string, string)

The value of the header with the given name in the request must not end with the specified characters.

public static HeaderMatch ValueDoesNotEndWith(string headerName, string suffix)
Parameters
headerName string

the name of the header to match against.

suffix string

The suffix to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueDoesNotMatchRegex(string, string)

The value of the header with the given name in the request must not include the specified characters.

public static HeaderMatch ValueDoesNotMatchRegex(string headerName, string regex)
Parameters
headerName string

the name of the header to match against.

regex string

The regex to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueDoesNotStartWith(string, string)

The value of the header with the given name in the request must not start with the specified characters.

public static HeaderMatch ValueDoesNotStartWith(string headerName, string prefix)
Parameters
headerName string

the name of the header to match against.

prefix string

The prefix to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueEndsWith(string, string)

The value of the header with the given name in the request must end with the specified characters.

public static HeaderMatch ValueEndsWith(string headerName, string suffix)
Parameters
headerName string

the name of the header to match against.

suffix string

The suffix to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueIs(string, string)

The value of the header with the given name in the request must match the specified value exactly.

public static HeaderMatch ValueIs(string headerName, string headerValue)
Parameters
headerName string

the name of the header to match against.

headerValue string

The exact value to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueIsNot(string, string)

The value of the header with the given name in the request must not match the specified value exactly.

public static HeaderMatch ValueIsNot(string headerName, string headerValue)
Parameters
headerName string

the name of the header to match against.

headerValue string

The exact value to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueMatchesRegex(string, string)

The value of the header with the given name in the request must include the specified characters.

public static HeaderMatch ValueMatchesRegex(string headerName, string regex)
Parameters
headerName string

the name of the header to match against.

regex string

The regex to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValueStartsWith(string, string)

The value of the header with the given name in the request must start with the specified characters.

public static HeaderMatch ValueStartsWith(string headerName, string prefix)
Parameters
headerName string

the name of the header to match against.

prefix string

The prefix to test against.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValuesIsInRange(string, double, double)

The value of the header with the given name in the request must be in a range of values.

public static HeaderMatch ValuesIsInRange(string headerName, double start, double end)
Parameters
headerName string

the name of the header to match against.

start double

Match on values starting at and including this value.

end double

Match on values up to but not including this value.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

ValuesIsNotInRange(string, double, double)

The value of the header with the given name in the request must not be in a range of values.

public static HeaderMatch ValuesIsNotInRange(string headerName, double start, double end)
Parameters
headerName string

the name of the header to match against.

start double

Match on values starting at and including this value.

end double

Match on values up to but not including this value.

Returns

HeaderMatch

Remarks

ExampleMetadata: infused

Back to top Generated by DocFX