ReqRest
Show / Hide Table of Contents

Class HttpRequestPropertiesBuilderExtensions

Defines the static methods for an IHttpRequestPropertiesBuilder provided by the library.

Inheritance
Object
HttpRequestPropertiesBuilderExtensions
Namespace: ReqRest.Builders
Assembly: ReqRest.dll
Syntax
public static class HttpRequestPropertiesBuilderExtensions

Methods

AddProperty<T>(T, String, Nullable<Object>)

Adds the specified property and value to the properties of the HTTP request which is being built. If a property with the specified key already exists, an exception is thrown.

Declaration
public static T AddProperty<T>(this T builder, string key, object? value)
    where T : IHttpRequestPropertiesBuilder
Parameters
Type Name Description
T builder

The builder.

String key

The key of the property.

Nullable<Object> value

The value of the property. This can be null.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentException

The properties already contain a property with the key.

ArgumentNullException
  • builder
  • key

ClearProperties<T>(T)

Removes all properties from the properties of the HTTP request which is being built.

Declaration
public static T ClearProperties<T>(this T builder)
    where T : IHttpRequestPropertiesBuilder
Parameters
Type Name Description
T builder

The builder.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder

ConfigureProperties<T>(T, Action<IDictionary<String, Nullable<Object>>>)

Executes the specified configureProperties function to modify the properties of the HTTP request which is being built.

Declaration
public static T ConfigureProperties<T>(this T builder, Action<IDictionary<string, object? >> configureProperties)
    where T : IHttpRequestPropertiesBuilder
Parameters
Type Name Description
T builder

The builder.

Action<IDictionary<String, Nullable<Object>>> configureProperties

A function which receives the request's properties. The function can then modify the properties as desired.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • configureProperties

RemoveProperty<T>(T, Nullable<String>[], names)

Removes the properties with the specified names from the properties of the HTTP request which is being built.

Declaration
public static T RemoveProperty<T>(this T builder, params string? [], names)
    where T : IHttpRequestPropertiesBuilder
Parameters
Type Name Description
T builder

The builder.

Nullable<String>[]
names
Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder

SetProperty<T>(T, String, Nullable<Object>)

Adds the specified property and value to the properties of the HTTP request which is being built. If a property with the specified key already exists, it is overwritten.

Declaration
public static T SetProperty<T>(this T builder, string key, object? value)
    where T : IHttpRequestPropertiesBuilder
Parameters
Type Name Description
T builder

The builder.

String key

The key of the property.

Nullable<Object> value

The value of the property. This can be null.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • key
Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)