# YarpRouteExtensions

- Kind: `class`
- Package: [Aspire.Hosting.Yarp](/reference/api/csharp/aspire.hosting.yarp.md)
- Version: `13.4.0`
- Namespace: `Aspire.Hosting.Yarp`
- Target framework: `net8.0`
- Source: [GitHub](https://github.com/microsoft/aspire/blob/cbc352350f1a9bafbaff10d14a2c8de4ac186a48/src/Aspire.Hosting.Yarp/ConfigurationBuilder/YarpRoute.cs)

Provides extension methods for configuring a YARP destination

## Definition

```csharp
namespace Aspire.Hosting.Yarp;

public static class YarpRouteExtensions
{
    // ...
}
```

## Methods

- [WithMatch(YarpRoute, RouteMatch)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatch-yarproute-routematch) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats ignored` -- Set the parameters used to match requests.
- [WithMatchHeaders(YarpRoute, RouteHeader[])](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatchheaders-yarproute-routeheader) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats ignored` -- Only match requests that contain all of these headers.
- [WithMatchHosts(YarpRoute, string[])](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatchhosts-yarproute-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Only match requests with the given Host header. Supports wildcards and ports. For unicode host names, do not use punycode.
- [WithMatchMethods(YarpRoute, string[])](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatchmethods-yarproute-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Only match requests that use these optional HTTP methods. E.g. GET, POST.
- [WithMatchPath(YarpRoute, string)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatchpath-yarproute-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Only match requests with the given Path pattern.
- [WithMatchRouteQueryParameter(YarpRoute, RouteQueryParameter[])](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmatchroutequeryparameter-yarproute-routequeryparameter) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats ignored` -- Only match requests that contain all of these query parameters.
- [WithMaxRequestBodySize(YarpRoute, long)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmaxrequestbodysize-yarproute-long) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Set the MaxRequestBodySize for the destination
- [WithMetadata(YarpRoute, IReadOnlyDictionary<string, string>)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withmetadata-yarproute-ireadonlydictionary-string-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Set the Metadata of the destination
- [WithOrder(YarpRoute, int?)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withorder-yarproute-int) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Set the order for the destination
- [WithTransform(YarpRoute, Action<IDictionary<string, string>>)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withtransform-yarproute-action-idictionary-string-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats ignored` -- Add a new transform to the destination
- [WithTransforms(YarpRoute, IReadOnlyList<IReadOnlyDictionary<string, string>>)](/reference/api/csharp/aspire.hosting.yarp/yarprouteextensions/methods.md#withtransforms-yarproute-ireadonlylist-ireadonlydictionary-string-string) : [YarpRoute](/reference/api/csharp/aspire.hosting.yarp/yarproute.md) `extension` `ats export` -- Set the Transforms of the destination
