AuthenticationHeaderValue Constructeurs

Définition

Initialise une nouvelle instance de la classe AuthenticationHeaderValue.

Surcharges

AuthenticationHeaderValue(String)

Initialise une nouvelle instance de la classe AuthenticationHeaderValue.

AuthenticationHeaderValue(String, String)

Initialise une nouvelle instance de la classe AuthenticationHeaderValue.

AuthenticationHeaderValue(String)

Source:
AuthenticationHeaderValue.cs
Source:
AuthenticationHeaderValue.cs
Source:
AuthenticationHeaderValue.cs

Initialise une nouvelle instance de la classe 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)

Paramètres

scheme
String

Schéma à utiliser pour l’autorisation.

Remarques

Exemple :

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

Génère l’en-tête suivant :

Authorization: ACCESS_TOKEN

S’applique à

AuthenticationHeaderValue(String, String)

Source:
AuthenticationHeaderValue.cs
Source:
AuthenticationHeaderValue.cs
Source:
AuthenticationHeaderValue.cs

Initialise une nouvelle instance de la classe 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)

Paramètres

scheme
String

Schéma à utiliser pour l’autorisation.

parameter
String

Informations d’identification contenant les informations d’authentification de l’agent utilisateur pour la ressource demandée.

Remarques

Exemple :

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

Génère l’en-tête suivant :

Authorization: Bearer ACCESS_TOKEN

S’applique à