YarpRouteExtensions Methods
ClassMethods11 members
Provides extension methods for configuring a YARP destination
Set the parameters used to match requests.
public static class YarpRouteExtensions{ public static YarpRoute WithMatch( this YarpRoute route, RouteMatch match) { // ... }}Parameters
routeYarpRoutematchRouteMatchRemarks
This overload is not available in polyglot app hosts. Use the DTO-based overload or the specific match helper methods instead.
WithMatchHeaders(YarpRoute, RouteHeader[])Section titled WithMatchHeaders(YarpRoute, RouteHeader[])extensionYarpRoute Only match requests that contain all of these headers.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchHeaders( this YarpRoute route, params RouteHeader[] headers) { // ... }}Parameters
routeYarpRouteheadersRouteHeader[]Remarks
This overload is not available in polyglot app hosts. Use the DTO-based overload instead.
WithMatchHosts(YarpRoute, string[])Section titled WithMatchHosts(YarpRoute, string[])extensionYarpRoute Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchHosts( this YarpRoute route, params string[] hosts) { // ... }}Parameters
routeYarpRoutehostsstring[]WithMatchMethods(YarpRoute, string[])Section titled WithMatchMethods(YarpRoute, string[])extensionYarpRoute Only match requests that use these optional HTTP methods. E.g. GET, POST.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchMethods( this YarpRoute route, params string[] methods) { // ... }}Parameters
routeYarpRoutemethodsstring[] Only match requests with the given Path pattern.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchPath( this YarpRoute route, string path) { // ... }}Parameters
routeYarpRoutepathstringWithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[])Section titled WithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[])extensionYarpRoute Only match requests that contain all of these query parameters.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchRouteQueryParameter( this YarpRoute route, params RouteQueryParameter[] queryParameters) { // ... }}Parameters
routeYarpRoutequeryParametersRouteQueryParameter[]Remarks
This overload is not available in polyglot app hosts. Use the DTO-based overload instead.
WithMaxRequestBodySize(YarpRoute, long)Section titled WithMaxRequestBodySize(YarpRoute, long)extensionYarpRoute Set the MaxRequestBodySize for the destination
public static class YarpRouteExtensions{ public static YarpRoute WithMaxRequestBodySize( this YarpRoute route, long maxRequestBodySize) { // ... }}Parameters
routeYarpRoutemaxRequestBodySizelongWithMetadata(YarpRoute, IReadOnlyDictionary<string, string>)Section titled WithMetadata(YarpRoute, IReadOnlyDictionary<string, string>)extensionYarpRoute Set the Metadata of the destination
public static class YarpRouteExtensions{ public static YarpRoute WithMetadata( this YarpRoute route, IReadOnlyDictionary<string, string>? metadata) { // ... }}Parameters
routeYarpRoutemetadataIReadOnlyDictionary<string, string> Set the order for the destination
public static class YarpRouteExtensions{ public static YarpRoute WithOrder( this YarpRoute route, int? order) { // ... }}Parameters
routeYarpRouteorderint?WithTransform(YarpRoute, Action<IDictionary<string, string>>)Section titled WithTransform(YarpRoute, Action<IDictionary<string, string>>)extensionYarpRoute Add a new transform to the destination
public static class YarpRouteExtensions{ public static YarpRoute WithTransform( this YarpRoute route, Action<IDictionary<string, string>> createTransform) { // ... }}Parameters
routeYarpRoutecreateTransformAction<IDictionary<string, string>>Remarks
This method is not available in polyglot app hosts. Use
YarpRouteExtensions.WithTransforms or the transform-specific helpers instead.WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>)Section titled WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>)extensionYarpRoute Set the Transforms of the destination
public static class YarpRouteExtensions{ public static YarpRoute WithTransforms( this YarpRoute route, IReadOnlyList<IReadOnlyDictionary<string, string>>? transforms) { // ... }}Parameters
routeYarpRoutetransformsIReadOnlyList<IReadOnlyDictionary<string, string>>