AuthenticationHeaderValue Konstruktory

Definicja

Inicjuje nowe wystąpienie klasy AuthenticationHeaderValue.

Przeciążenia

AuthenticationHeaderValue(String)

Inicjuje nowe wystąpienie klasy AuthenticationHeaderValue.

AuthenticationHeaderValue(String, String)

Inicjuje nowe wystąpienie klasy AuthenticationHeaderValue.

AuthenticationHeaderValue(String)

Źródło:
AuthenticationHeaderValue.cs
Źródło:
AuthenticationHeaderValue.cs
Źródło:
AuthenticationHeaderValue.cs

Inicjuje nowe wystąpienie klasy AuthenticationHeaderValue.

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

Schemat używany do autoryzacji.

Uwagi

Przykład:

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

Spowoduje wygenerowanie następującego nagłówka:

Authorization: ACCESS_TOKEN

Dotyczy

AuthenticationHeaderValue(String, String)

Źródło:
AuthenticationHeaderValue.cs
Źródło:
AuthenticationHeaderValue.cs
Źródło:
AuthenticationHeaderValue.cs

Inicjuje nowe wystąpienie klasy AuthenticationHeaderValue.

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

Schemat używany do autoryzacji.

parameter
String

Poświadczenia zawierające informacje o uwierzytelnianiu agenta użytkownika dla żądanego zasobu.

Uwagi

Przykład:

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

Spowoduje wygenerowanie następującego nagłówka:

Authorization: Bearer ACCESS_TOKEN

Dotyczy