ReqRest
Show / Hide Table of Contents

Class HttpRequestMessageBuilderExtensions

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

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

Methods

ConfigureRequest<T>(T, Action<HttpRequestMessage>)

Executes the specified configureRequest function to modify the HttpRequestMessage which is being built.

Declaration
public static T ConfigureRequest<T>(this T builder, Action<HttpRequestMessage> configureRequest)
    where T : IHttpRequestMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Action<HttpRequestMessage> configureRequest

A function which receives the builder's HttpRequestMessage object. The function can then modify the message as desired.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • configureRequest

ConfigureRequest<T>(T, Func<HttpRequestMessage, HttpRequestMessage>)

Executes the specified setRequest function to modify and/or change the HttpRequestMessage which is being built.

Declaration
public static T ConfigureRequest<T>(this T builder, Func<HttpRequestMessage, HttpRequestMessage> setRequest)
    where T : IHttpRequestMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Func<HttpRequestMessage, HttpRequestMessage> setRequest

A function which receives the builder's HttpRequestMessage object. The function must return an HttpRequestMessage which is then used as the builder's new request message.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • setRequest
  • The result of setRequest is null.

ConfigureRequest<T>(T, Func<HttpRequestMessage>)

Executes the specified setRequest function to change the HttpRequestMessage which is being built.

Declaration
public static T ConfigureRequest<T>(this T builder, Func<HttpRequestMessage> setRequest)
    where T : IHttpRequestMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Func<HttpRequestMessage> setRequest

A function which must return an HttpRequestMessage which is then used as the builder's new request message.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • setRequest
  • The result of setRequest is null.

SetRequest<T>(T, HttpRequestMessage)

Sets the HttpRequestMessage which is being built.

Declaration
public static T SetRequest<T>(this T builder, HttpRequestMessage httpRequestMessage)
    where T : IHttpRequestMessageBuilder
Parameters
Type Name Description
T builder

The builder.

HttpRequestMessage httpRequestMessage

The new HttpRequestMessage to be used.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

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