Legend

Class
Struct
Enum
Interface
Delegate
Constructor
Method
Property
Event
Field

Extension method: IHttpUrl With(this IHttpUrl, string, bool, bool)

Declaration

public static IHttpUrl With(
    this IHttpUrl url,
    string pathOrSubdomain,
    bool useSubdomain = false,
    bool retainQueryParams = false
)

Summary

Changes a URL’s subpath or subdomain.

Parameters

this IHttpUrlurl The URL to modify.
stringpathOrSubdomain The new subpath or subdomain, without any slashes or dots.
booluseSubdomain If true, the subdomain is changed; if false (default), the path is changed.
boolretainQueryParams If true, the query parameters are retained; if false (default), they are removed.

Returns

The new URL.