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
<Extension()>
Public Sub SetUserPrincipal (httpRequestMessage As HttpRequestMessage, user As IPrincipal)

参数

httpRequestMessage
HttpRequestMessage

来自设置用户主体的 HTTP 请求消息。The HTTP request message from which to set the user principal.

user
IPrincipal

要设置用户主体。The user principal to set.

适用于