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
routeYarpmatchRouteMatch Remarks
This overload is not available in polyglot AppHosts. Use the DTO-based overload or the specific match helper methods instead.
WithMatchHeaders(YarpRoute, RouteHeader[]) Section titled WithMatchHeaders(YarpRoute, RouteHeader[])extensionYarp Only match requests that contain all of these headers.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchHeaders( this YarpRoute route, params RouteHeader[] headers) { // ... }}Parameters
routeYarpheadersRouteHeader[] Remarks
This overload is not available in polyglot AppHosts. Use the DTO-based overload instead.
WithMatchHosts(YarpRoute, string[]) Section titled WithMatchHosts(YarpRoute, string[])extensionYarp 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
routeYarphostsstring[]WithMatchMethods(YarpRoute, string[]) Section titled WithMatchMethods(YarpRoute, string[])extensionYarp 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
routeYarpmethodsstring[] Only match requests with the given Path pattern.
public static class YarpRouteExtensions{ public static YarpRoute WithMatchPath( this YarpRoute route, string path) { // ... }}Parameters
routeYarppathstringWithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[]) Section titled WithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[])extensionYarp 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
routeYarpqueryParameters RouteQueryParameter[] Remarks
This overload is not available in polyglot AppHosts. Use the DTO-based overload instead.
WithMaxRequestBodySize(YarpRoute, long) Section titled WithMaxRequestBodySize(YarpRoute, long)extensionYarp Set the MaxRequestBodySize for the destination
public static class YarpRouteExtensions{ public static YarpRoute WithMaxRequestBodySize( this YarpRoute route, long maxRequestBodySize) { // ... }}Parameters
routeYarpmaxRequestBodySize longWithMetadata(YarpRoute, IReadOnlyDictionary<string, string>) Section titled WithMetadata(YarpRoute, IReadOnlyDictionary<string, string>)extensionYarp Set the Metadata of the destination
public static class YarpRouteExtensions{ public static YarpRoute WithMetadata( this YarpRoute route, IReadOnlyDictionary<string, string>? metadata) { // ... }}Parameters
routeYarpmetadataIReadOnlyDictionary<string, string> Set the order for the destination
public static class YarpRouteExtensions{ public static YarpRoute WithOrder( this YarpRoute route, int? order) { // ... }}Parameters
routeYarporderint?WithTransform(YarpRoute, Action<IDictionary<string, string>>) Section titled WithTransform(YarpRoute, Action<IDictionary<string, string>>)extensionYarp Add a new transform to the destination
public static class YarpRouteExtensions{ public static YarpRoute WithTransform( this YarpRoute route, Action<IDictionary<string, string>> createTransform) { // ... }}Parameters
routeYarpcreateTransform Action<IDictionary<string, string>> Remarks
This method is not available in polyglot AppHosts. Use
YarpRouteExtensions.WithTransforms or the transform-specific helpers instead.WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>) Section titled WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>)extensionYarp Set the Transforms of the destination
public static class YarpRouteExtensions{ public static YarpRoute WithTransforms( this YarpRoute route, IReadOnlyList<IReadOnlyDictionary<string, string>>? transforms) { // ... }}Parameters
routeYarptransformsIReadOnlyList<IReadOnlyDictionary<string, string>>