Class UriModifyExtensions
Uri extensions which modify an Uri (return a new one)
Inheritance
Inherited Members
Namespace: Dapplo.HttpExtensions
Assembly: Dapplo.HttpExtensions.dll
Syntax
public static class UriModifyExtensions
Methods
| Improve this Doc View SourceAppendSegments(Uri, Func<String, String>, IEnumerable<String>)
Append segment(s) to the path of the specified Uri. When adding a segment the logic takes care that there is always one single slash separating the segments. Null or empty segments are ignored.
Declaration
public static Uri AppendSegments(this Uri uri, Func<string, string> urlEscapeFunc, IEnumerable<string> segments)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
Func<System.String, System.String> | urlEscapeFunc | Func used for the encoding |
IEnumerable<System.String> | segments | IEnumerable of string with the segments which need to be added |
Returns
Type | Description |
---|---|
Uri | new Uri with segments added to the path |
AppendSegments(Uri, Func<String, String>, Object[])
Append path segment(s) to the specified Uri When adding a segment the logic takes care that there is always one single slash separating the segments. Null or empty segments are ignored.
Declaration
public static Uri AppendSegments(this Uri uri, Func<string, string> urlEscapeFunc, params object[] segments)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
Func<System.String, System.String> | urlEscapeFunc | Func used for the encoding |
System.Object[] | segments | params with objects which will be converted to string and adding them as segments |
Returns
Type | Description |
---|---|
Uri | new Uri with segments added to the path |
AppendSegments(Uri, IEnumerable<String>)
Append segment(s) to the path of the specified Uri. When adding a segment the logic takes care that there is always one single slash separating the segments. Null or empty segments are ignored.
Declaration
public static Uri AppendSegments(this Uri uri, IEnumerable<string> segments)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
IEnumerable<System.String> | segments | IEnumerable of string with the segments which need to be added |
Returns
Type | Description |
---|---|
Uri | new Uri with segments added to the path |
AppendSegments(Uri, Object[])
Append path segment(s) to the specified Uri When adding a segment the logic takes care that there is always one single slash separating the segments. Null or empty segments are ignored.
Declaration
public static Uri AppendSegments(this Uri uri, params object[] segments)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
System.Object[] | segments | params with objects which will be converted to string and adding them as segments |
Returns
Type | Description |
---|---|
Uri | new Uri with segments added to the path |
ExtendQuery<T>(Uri, IDictionary<String, T>)
Adds query string value to an existing url, both absolute and relative URI's are supported.
Declaration
public static Uri ExtendQuery<T>(this Uri uri, IDictionary<string, T> values)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
IDictionary<System.String, T> | values | IDictionary with values |
Returns
Type | Description |
---|---|
Uri | Uri with extended query |
Type Parameters
Name | Description |
---|---|
T |
ExtendQuery<T>(Uri, IEnumerable<KeyValuePair<String, T>>)
Adds query string value to an existing url, both absolute and relative URI's are supported.
Declaration
public static Uri ExtendQuery<T>(this Uri uri, IEnumerable<KeyValuePair<string, T>> values)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
IEnumerable<KeyValuePair<System.String, T>> | values | IEnumerable of KeyValuePair with values |
Returns
Type | Description |
---|---|
Uri | Uri with extended query |
Type Parameters
Name | Description |
---|---|
T |
ExtendQuery<T>(Uri, ILookup<String, T>)
Adds query string value to an existing url, both absolute and relative URI's are supported.
Declaration
public static Uri ExtendQuery<T>(this Uri uri, ILookup<string, T> values)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend the query for |
System.Linq.ILookup<System.String, T> | values | ILookup with values |
Returns
Type | Description |
---|---|
Uri | Uri with extended query |
Type Parameters
Name | Description |
---|---|
T |
ExtendQuery<T>(Uri, String, T)
Adds query string value to an existing url, both absolute and relative URI's are supported.
Declaration
public static Uri ExtendQuery<T>(this Uri uri, string name, T value)
Parameters
Type | Name | Description |
---|---|---|
Uri | uri | Uri to extend |
System.String | name | string name of value |
T | value | value |
Returns
Type | Description |
---|---|
Uri | Uri with extended query |
Type Parameters
Name | Description |
---|---|
T |