DownstreamWebApi.CallWebApiForAppAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Calls the downstream web API for the app, with the required scopes.
public System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage> CallWebApiForAppAsync (string serviceName, string? authenticationScheme, Action<Microsoft.Identity.Web.DownstreamWebApiOptions>? downstreamWebApiOptionsOverride = default, System.Net.Http.StringContent? content = default);
abstract member CallWebApiForAppAsync : string * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Net.Http.StringContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
override this.CallWebApiForAppAsync : string * string * Action<Microsoft.Identity.Web.DownstreamWebApiOptions> * System.Net.Http.StringContent -> System.Threading.Tasks.Task<System.Net.Http.HttpResponseMessage>
Public Function CallWebApiForAppAsync (serviceName As String, authenticationScheme As String, Optional downstreamWebApiOptionsOverride As Action(Of DownstreamWebApiOptions) = Nothing, Optional content As StringContent = Nothing) As Task(Of HttpResponseMessage)
Parameters
- serviceName
- 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.
- authenticationScheme
- String
Authentication scheme. If null, will use OpenIdConnectDefault.AuthenticationScheme if called from a web app, and JwtBearerDefault.AuthenticationScheme if called from a web API.
- downstreamWebApiOptionsOverride
- Action<DownstreamWebApiOptions>
Overrides the options proposed in the configuration described
by serviceName
.
- content
- StringContent
HTTP content in the case where HttpMethod is Patch, Post, Put.
Returns
An HttpResponseMessage that the application will process.