DownstreamWebApiGenericExtensions.PutForUserAsync Method

Definition

Overloads

PutForUserAsync<TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Calls the web API endpoint with an HttpPut, providing strongly typed input data.

PutForUserAsync<TOutput,TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Calls the web API endpoint with an HttpPut, provinding strongly typed input data and getting back strongly typed data.

PutForUserAsync<TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Calls the web API endpoint with an HttpPut, providing strongly typed input data.

public static System.Threading.Tasks.Task PutForUserAsync<TInput> (this Microsoft.Identity.Web.IDownstreamWebApi downstreamWebApi, string serviceName, string relativePath, TInput inputData, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default, string? authenticationScheme = default);
static member PutForUserAsync : Microsoft.Identity.Web.IDownstreamWebApi * string * string * 'Input * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task
<Extension()>
Public Function PutForUserAsync(Of TInput) (downstreamWebApi As IDownstreamWebApi, serviceName As String, relativePath As String, inputData As TInput, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing, Optional authenticationScheme As String = Nothing) As Task

Type Parameters

TInput

Input type.

Parameters

downstreamWebApi
IDownstreamWebApi

The downstream web API.

serviceName
System.String

Name of the service describing the downstream web API. There can be several configuration named sections mapped to a DownstreamWebApiOptions, each for one downstream web API. You can pass-in null, but in that case downstreamWebApiOptionsOverride needs to be set.

relativePath
System.String

Path to the API endpoint relative to the base URL specified in the configuration.

inputData
TInput

Input data sent to the API.

downstreamWebApiOptionsOverride
System.Action<DownstreamWebApiOptions>

Overrides the options proposed in the configuration described by serviceName.

user
System.Security.Claims.ClaimsPrincipal

[Optional] Claims representing a user. This is useful in platforms like Blazor or Azure Signal R, where the HttpContext is not available. In other platforms, the library will find the user from the HttpContext.

authenticationScheme
System.String

Authentication scheme. If null, will use OpenIdConnectDefault.AuthenticationScheme if called from a web app, and JwtBearerDefault.AuthenticationScheme if called from a web API.

Returns

System.Threading.Tasks.Task

The value returned by the downstream web API.

Applies to

PutForUserAsync<TOutput,TInput>(IDownstreamWebApi, String, String, TInput, Action<DownstreamWebApiOptions>, ClaimsPrincipal, String)

Calls the web API endpoint with an HttpPut, provinding strongly typed input data and getting back strongly typed data.

public static System.Threading.Tasks.Task<TOutput?> PutForUserAsync<TOutput,TInput> (this Microsoft.Identity.Web.IDownstreamWebApi downstreamWebApi, string serviceName, string relativePath, TInput inputData, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Security.Claims.ClaimsPrincipal? user = default, string? authenticationScheme = default) where TOutput : class;
static member PutForUserAsync : Microsoft.Identity.Web.IDownstreamWebApi * string * string * 'Input * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Security.Claims.ClaimsPrincipal * string -> System.Threading.Tasks.Task<'Output (requires 'Output : null)> (requires 'Output : null)
<Extension()>
Public Function PutForUserAsync(Of TOutput As Class, TInput As Class) (downstreamWebApi As IDownstreamWebApi, serviceName As String, relativePath As String, inputData As TInput, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional user As ClaimsPrincipal = Nothing, Optional authenticationScheme As String = Nothing) As Task(Of TOutput)

Type Parameters

TOutput

Output type.

TInput

Input type.

Parameters

downstreamWebApi
IDownstreamWebApi

The downstream web API.

serviceName
System.String

Name of the service describing the downstream web API. There can be several configuration named sections mapped to a DownstreamWebApiOptions, each for one downstream web API. You can pass-in null, but in that case downstreamWebApiOptionsOverride needs to be set.

relativePath
System.String

Path to the API endpoint relative to the base URL specified in the configuration.

inputData
TInput

Input data sent to the API.

downstreamWebApiOptionsOverride
System.Action<DownstreamWebApiOptions>

Overrides the options proposed in the configuration described by serviceName.

user
System.Security.Claims.ClaimsPrincipal

[Optional] Claims representing a user. This is useful in platforms like Blazor or Azure Signal R, where the HttpContext is not available. In other platforms, the library will find the user from the HttpContext.

authenticationScheme
System.String

Authentication scheme. If null, will use OpenIdConnectDefault.AuthenticationScheme if called from a web app, and JwtBearerDefault.AuthenticationScheme if called from a web API.

Returns

System.Threading.Tasks.Task<TOutput>

A strongly typed response from the web API.

Applies to