Skip to content
Docs Try Aspire

YarpRouteExtensions Methods

Class Methods 11 members
Provides extension methods for configuring a YARP destination
WithMatch(YarpRoute, RouteMatch) Section titled WithMatch(YarpRoute, RouteMatch) extension YarpRoute
Set the parameters used to match requests.
public static class YarpRouteExtensions
{
public static YarpRoute WithMatch(
this YarpRoute route,
RouteMatch match)
{
// ...
}
}
route YarpRoute
match RouteMatch
WithMatchHeaders(YarpRoute, RouteHeader[]) Section titled WithMatchHeaders(YarpRoute, RouteHeader[]) extension YarpRoute
Only match requests that contain all of these headers.
public static class YarpRouteExtensions
{
public static YarpRoute WithMatchHeaders(
this YarpRoute route,
params RouteHeader[] headers)
{
// ...
}
}
route YarpRoute
headers RouteHeader[]
WithMatchHosts(YarpRoute, string[]) Section titled WithMatchHosts(YarpRoute, string[]) extension YarpRoute
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)
{
// ...
}
}
route YarpRoute
hosts string[]
WithMatchMethods(YarpRoute, string[]) Section titled WithMatchMethods(YarpRoute, string[]) extension YarpRoute
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)
{
// ...
}
}
route YarpRoute
methods string[]
WithMatchPath(YarpRoute, string) Section titled WithMatchPath(YarpRoute, string) extension YarpRoute
Only match requests with the given Path pattern.
public static class YarpRouteExtensions
{
public static YarpRoute WithMatchPath(
this YarpRoute route,
string path)
{
// ...
}
}
route YarpRoute
path string
WithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[]) Section titled WithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[]) extension YarpRoute
Only match requests that contain all of these query parameters.
public static class YarpRouteExtensions
{
public static YarpRoute WithMatchRouteQueryParameter(
this YarpRoute route,
params RouteQueryParameter[] queryParameters)
{
// ...
}
}
route YarpRoute
queryParameters RouteQueryParameter[]
WithMaxRequestBodySize(YarpRoute, long) Section titled WithMaxRequestBodySize(YarpRoute, long) extension YarpRoute
Set the MaxRequestBodySize for the destination
public static class YarpRouteExtensions
{
public static YarpRoute WithMaxRequestBodySize(
this YarpRoute route,
long maxRequestBodySize)
{
// ...
}
}
route YarpRoute
maxRequestBodySize long
WithMetadata(YarpRoute, IReadOnlyDictionary<string, string>) Section titled WithMetadata(YarpRoute, IReadOnlyDictionary<string, string>) extension YarpRoute
Set the Metadata of the destination
public static class YarpRouteExtensions
{
public static YarpRoute WithMetadata(
this YarpRoute route,
IReadOnlyDictionary<string, string>? metadata)
{
// ...
}
}
route YarpRoute
metadata IReadOnlyDictionary<string, string>
WithOrder(YarpRoute, int?) Section titled WithOrder(YarpRoute, int?) extension YarpRoute
Set the order for the destination
public static class YarpRouteExtensions
{
public static YarpRoute WithOrder(
this YarpRoute route,
int? order)
{
// ...
}
}
route YarpRoute
order int?
WithTransform(YarpRoute, Action<IDictionary<string, string>>) Section titled WithTransform(YarpRoute, Action<IDictionary<string, string>>) extension YarpRoute
Add a new transform to the destination
public static class YarpRouteExtensions
{
public static YarpRoute WithTransform(
this YarpRoute route,
Action<IDictionary<string, string>> createTransform)
{
// ...
}
}
route YarpRoute
createTransform Action<IDictionary<string, string>>
WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>) Section titled WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>) extension YarpRoute
Set the Transforms of the destination
public static class YarpRouteExtensions
{
public static YarpRoute WithTransforms(
this YarpRoute route,
IReadOnlyList<IReadOnlyDictionary<string, string>>? transforms)
{
// ...
}
}
route YarpRoute
transforms IReadOnlyList<IReadOnlyDictionary<string, string>>