ReqRest
Show / Hide Table of Contents

Class HttpResponseMessageBuilderExtensions

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

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

Methods

ConfigureResponse<T>(T, Action<HttpResponseMessage>)

Executes the specified configureResponse function to modify the HttpResponseMessage which is being built.

Declaration
public static T ConfigureResponse<T>(this T builder, Action<HttpResponseMessage> configureResponse)
    where T : IHttpResponseMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Action<HttpResponseMessage> configureResponse

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

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

Exceptions
Type Condition
ArgumentNullException
  • builder
  • configureResponse

ConfigureResponse<T>(T, Func<HttpResponseMessage, HttpResponseMessage>)

Executes the specified setResponse function to modify and/or change the HttpResponseMessage which is being built.

Declaration
public static T ConfigureResponse<T>(this T builder, Func<HttpResponseMessage, HttpResponseMessage> setResponse)
    where T : IHttpResponseMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Func<HttpResponseMessage, HttpResponseMessage> setResponse

A function which receives the builder's HttpResponseMessage object. The function must return an HttpResponseMessage which is then used as the builder's new response.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

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

ConfigureResponse<T>(T, Func<HttpResponseMessage>)

Executes the specified setResponse function to change the HttpResponseMessage which is being built.

Declaration
public static T ConfigureResponse<T>(this T builder, Func<HttpResponseMessage> setResponse)
    where T : IHttpResponseMessageBuilder
Parameters
Type Name Description
T builder

The builder.

Func<HttpResponseMessage> setResponse

A function which must return an HttpResponseMessage which is then used as the builder's new response.

Returns
Type Description
T

The specified builder.

Type Parameters
Name Description
T

The type of the builder.

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

SetResponse<T>(T, HttpResponseMessage)

Sets the HttpResponseMessage which is being built.

Declaration
public static T SetResponse<T>(this T builder, HttpResponseMessage httpResponseMessage)
    where T : IHttpResponseMessageBuilder
Parameters
Type Name Description
T builder

The builder.

HttpResponseMessage httpResponseMessage

The new HttpResponseMessage 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
  • httpResponseMessage
Back to top Copyright © 2019 ReqRest - Generated with DocFX - Material Theme made by Oscar Vásquez - Impressum (Imprint)