語言

DownstreamWebApi.CallWebApiForAppAsync 方法

定義

呼叫應用程式的下游網頁 API,並附上所需的範圍。

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)

參數

serviceName
String

描述下游網頁 API 的服務名稱。 可以有多個命名為 的配置區段對應到 一個 DownstreamWebApiOptions,每個區段對應一個下游的網頁 API。 你可以用 pass-in null,但那 downstreamWebApiOptionsOverride 時必須設定。

authenticationScheme
String

認證方案。 若為空,則使用 OpenIdConnectDefault.AuthenticationScheme(從網頁應用程式呼叫),若從網頁 API 呼叫則使用 JwtBearerDefault.AuthenticationScheme。

downstreamWebApiOptionsOverride
Action<DownstreamWebApiOptions>

覆蓋由 描述 serviceName的配置中提出的選項。

content
StringContent

HTTP 內容 ,其中 HttpMethod 為 Patch、 Post、 Put。

傳回

而 HttpResponseMessage 申請會處理。

實作

適用於