HttpRequestMessageExtensionMethods.SetUserPrincipal(HttpRequestMessage, IPrincipal) 方法

定義

取代與指定之 HTTP 要求訊息相關聯的使用者主體。Replaces the user principal associated with the specified HTTP request message.

public:
[System::Runtime::CompilerServices::Extension]
 static void SetUserPrincipal(System::Net::Http::HttpRequestMessage ^ httpRequestMessage, System::Security::Principal::IPrincipal ^ user);
public static void SetUserPrincipal (this System.Net.Http.HttpRequestMessage httpRequestMessage, System.Security.Principal.IPrincipal user);
static member SetUserPrincipal : System.Net.Http.HttpRequestMessage * System.Security.Principal.IPrincipal -> unit

參數

httpRequestMessage
HttpRequestMessage

要在其中設定使用者主體的 HTTP 要求訊息。The HTTP request message from which to set the user principal.

user
IPrincipal

要設定的使用者主體。The user principal to set.

適用於