AuthenticationHeaderValue Construtores

Definição

Inicializa uma nova instância da classe AuthenticationHeaderValue.Initializes a new instance of the AuthenticationHeaderValue class.

Sobrecargas

AuthenticationHeaderValue(String)

Inicializa uma nova instância da classe AuthenticationHeaderValue.Initializes a new instance of the AuthenticationHeaderValue class.

AuthenticationHeaderValue(String, String)

Inicializa uma nova instância da classe AuthenticationHeaderValue.Initializes a new instance of the AuthenticationHeaderValue class.

AuthenticationHeaderValue(String)

Inicializa uma nova instância da classe AuthenticationHeaderValue.Initializes a new instance of the AuthenticationHeaderValue class.

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)

Parâmetros

scheme
String

O esquema a ser usado para autorização.The scheme to use for authorization.

Comentários

Exemplo:Example:

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

Produzirá o seguinte cabeçalho:Will produce the following header:

Authorization: ACCESS_TOKEN

Aplica-se a

AuthenticationHeaderValue(String, String)

Inicializa uma nova instância da classe AuthenticationHeaderValue.Initializes a new instance of the AuthenticationHeaderValue class.

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)

Parâmetros

scheme
String

O esquema a ser usado para autorização.The scheme to use for authorization.

parameter
String

As credenciais que contém as informações de autenticação do agente do usuário para o recurso que está sendo solicitado.The credentials containing the authentication information of the user agent for the resource being requested.

Comentários

Exemplo:Example:

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

Produzirá o seguinte cabeçalho:Will produce the following header:

Authorization: Bearer ACCESS_TOKEN

Aplica-se a