ReqRest
Show / Hide Table of Contents

Class ApiRequestBaseExtensions

Extends the ApiRequestBase class with default extension methods provided by the library.

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

Methods

SetHttpClientProvider<T>(T, Func<HttpClient>)

Sets the HttpClientProvider function which returns an HttpClient instance which will ultimately be used to send the HttpRequestMessage for executing the API request.

Declaration
public static T SetHttpClientProvider<T>(this T request, Func<HttpClient> httpClientProvider)
    where T : ApiRequestBase
Parameters
Type Name Description
T request

The request.

Func<HttpClient> httpClientProvider

A function which returns an HttpClient instance which will ultimately be used to send the HttpRequestMessage for executing the API request.

Returns
Type Description
T

The specified request.

Type Parameters
Name Description
T

The type of the request.

Exceptions
Type Condition
ArgumentNullException
  • request
  • httpClientProvider

SetHttpClientProvider<T>(T, HttpClient)

Sets the HttpClientProvider function to a function which returns the specified httpClient.

Declaration
public static T SetHttpClientProvider<T>(this T request, HttpClient httpClient)
    where T : ApiRequestBase
Parameters
Type Name Description
T request

The request.

HttpClient httpClient

An HttpClient instance which will ultimately be used to send the HttpRequestMessage for executing the API request.

Returns
Type Description
T

The specified request.

Type Parameters
Name Description
T

The type of the request.

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