Class RequestUriBuilderExtensions
Defines the static methods for an IRequestUriBuilder provided by the library.
Namespace: ReqRest.Builders
Assembly: ReqRest.dll
Syntax
public static class RequestUriBuilderExtensions
Methods
ConfigureRequestUri<T>(T, Action<UrlBuilder>)
Executes the specified configure
method which allows configuring the
RequestUri via an UrlBuilder.
Declaration
public static T ConfigureRequestUri<T>(this T builder, Action<UrlBuilder> configure)
where T : IRequestUriBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Action<UrlBuilder> | configure | A method which receives a new UrlBuilder instance created from the current RequestUri. The Uri which was built with the provided UrlBuilder is used as the new RequestUri. |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
UriFormatException | The Uri which was built by the |
ConfigureRequestUri<T>(T, Func<UrlBuilder, Nullable<Uri>>)
Executes the specified configure
function which allows configuring the
RequestUri via an UrlBuilder.
Declaration
public static T ConfigureRequestUri<T>(this T builder, Func<UrlBuilder, Uri? > configure)
where T : IRequestUriBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Func<UrlBuilder, Nullable<Uri>> | configure | A function which receives a new UrlBuilder instance created from the current RequestUri. The resulting Uri is used as the new RequestUri. Hint: You can simply return the UrlBuilder, because it gets implicitly converted to an Uri. |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
UriFormatException | The Uri which was built by the |
SetRequestUri<T>(T, Nullable<String>)
Sets the request Uri which is being built.
Declaration
public static T SetRequestUri<T>(this T builder, string? requestUri)
where T : IRequestUriBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Nullable<String> | requestUri | A string which represents the request Uri to be used. This can be null. |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|
SetRequestUri<T>(T, Nullable<Uri>)
Sets the request Uri which is being built.
Declaration
public static T SetRequestUri<T>(this T builder, Uri? requestUri)
where T : IRequestUriBuilder
Parameters
Type | Name | Description |
---|---|---|
T | builder | The builder. |
Nullable<Uri> | requestUri | The request Uri used. This can be null. |
Returns
Type | Description |
---|---|
T | The specified |
Type Parameters
Name | Description |
---|---|
T | The type of the builder. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException |
|