AuthenticationHeaderValue Konstruktory

Definice

Inicializuje novou instanci AuthenticationHeaderValue třídy .

Přetížení

AuthenticationHeaderValue(String)

Inicializuje novou instanci AuthenticationHeaderValue třídy .

AuthenticationHeaderValue(String, String)

Inicializuje novou instanci AuthenticationHeaderValue třídy .

AuthenticationHeaderValue(String)

Zdroj:
AuthenticationHeaderValue.cs
Zdroj:
AuthenticationHeaderValue.cs
Zdroj:
AuthenticationHeaderValue.cs

Inicializuje novou instanci AuthenticationHeaderValue třídy .

public:
 AuthenticationHeaderValue(System::String ^ scheme);
public AuthenticationHeaderValue (string scheme);
new System.Net.Http.Headers.AuthenticationHeaderValue : string -> System.Net.Http.Headers.AuthenticationHeaderValue
Public Sub New (scheme As String)

Parametry

scheme
String

Schéma, které se má použít k autorizaci.

Poznámky

Příklad:

HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(ACCESS_TOKEN);
Dim client = New HttpClient()
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue(ACCESS_TOKEN)

Vytvoří následující hlavičku:

Authorization: ACCESS_TOKEN

Platí pro

AuthenticationHeaderValue(String, String)

Zdroj:
AuthenticationHeaderValue.cs
Zdroj:
AuthenticationHeaderValue.cs
Zdroj:
AuthenticationHeaderValue.cs

Inicializuje novou instanci AuthenticationHeaderValue třídy .

public:
 AuthenticationHeaderValue(System::String ^ scheme, System::String ^ parameter);
public AuthenticationHeaderValue (string scheme, string parameter);
public AuthenticationHeaderValue (string scheme, string? parameter);
new System.Net.Http.Headers.AuthenticationHeaderValue : string * string -> System.Net.Http.Headers.AuthenticationHeaderValue
Public Sub New (scheme As String, parameter As String)

Parametry

scheme
String

Schéma, které se má použít k autorizaci.

parameter
String

Přihlašovací údaje obsahující ověřovací informace uživatelského agenta pro požadovaný prostředek.

Poznámky

Příklad:

HttpClient client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ACCESS_TOKEN);
Dim client = new HttpClient()
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", ACCESS_TOKEN)

Vytvoří následující hlavičku:

Authorization: Bearer ACCESS_TOKEN

Platí pro