HttpClientJsonExtensions.GetFromJsonAsync Metodo
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Overload
| Nome | Descrizione |
|---|---|
| GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync(HttpClient, Uri, Type, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync(HttpClient, String, Type, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, String, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken) |
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona. |
GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As Uri, type As Type, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- options
- JsonSerializerOptions
Opzioni per controllare il comportamento durante la deserializzazione. Le opzioni predefinite sono quelle specificate da Web.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.Serialization.JsonSerializerContext context, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Text.Json.Serialization.JsonSerializerContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As String, type As Type, context As JsonSerializerContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- context
- JsonSerializerContext
JsonSerializerContext usato per controllare il comportamento di deserializzazione.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Text.Json.Serialization.JsonSerializerContext context, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Text.Json.Serialization.JsonSerializerContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As Uri, type As Type, context As JsonSerializerContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- context
- JsonSerializerContext
JsonSerializerContext usato per controllare il comportamento di deserializzazione.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync(HttpClient, Uri, Type, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, Uri? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As Uri, type As Type, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Commenti
Questo metodo usa JsonSerializerDefaults.Web le opzioni per la deserializzazione, mentre JsonSerializer per impostazione predefinita i metodi di deserializzazione non sono disponibili.
Si applica a
GetFromJsonAsync(HttpClient, String, Type, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As String, type As Type, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Commenti
Questo metodo usa JsonSerializerDefaults.Web le opzioni per la deserializzazione, mentre JsonSerializer per impostazione predefinita i metodi di deserializzazione non sono disponibili.
Si applica a
GetFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<object?> GetFromJsonAsync(this System.Net.Http.HttpClient client, string? requestUri, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function GetFromJsonAsync (client As HttpClient, requestUri As String, type As Type, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- type
- Type
Tipo dell'oggetto da deserializzare in e restituire.
- options
- JsonSerializerOptions
Opzioni per controllare il comportamento durante la deserializzazione. Le opzioni predefinite sono quelle specificate da Web.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, String, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As String, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Commenti
Questo metodo usa JsonSerializerDefaults.Web le opzioni per la deserializzazione, mentre JsonSerializer per impostazione predefinita i metodi di deserializzazione non sono disponibili.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Commenti
Questo metodo usa JsonSerializerDefaults.Web le opzioni per la deserializzazione, mentre JsonSerializer per impostazione predefinita i metodi di deserializzazione non sono disponibili.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As String, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- options
- JsonSerializerOptions
Opzioni per controllare il comportamento durante la deserializzazione. Le opzioni predefinite sono quelle specificate da Web.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsync : System.Net.Http.HttpClient * string * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As String, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- String
URI a cui viene inviata la richiesta.
- jsonTypeInfo
- JsonTypeInfo<TValue>
JsonTypeInfo usato per controllare il comportamento di deserializzazione.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
[System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")]
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")]
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
[<System.Diagnostics.CodeAnalysis.RequiresDynamicCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext.")>]
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
[<System.Diagnostics.CodeAnalysis.RequiresUnreferencedCode("JSON serialization and deserialization might require types that cannot be statically analyzed. Use the overload that takes a JsonTypeInfo or JsonSerializerContext, or make sure all of the required types are preserved.")>]
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- options
- JsonSerializerOptions
Opzioni per controllare il comportamento durante la deserializzazione. Le opzioni predefinite sono quelle specificate da Web.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
- Attributi
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.
Si applica a
GetFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
- Origine:
- HttpClientJsonExtensions.Get.cs
Invia una richiesta GET all'URI specificato e restituisce il valore risultante dalla deserializzazione del corpo della risposta come JSON in un'operazione asincrona.
public static System.Threading.Tasks.Task<TValue?> GetFromJsonAsync<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsync : System.Net.Http.HttpClient * Uri * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
<Extension()>
Public Function GetFromJsonAsync(Of TValue) (client As HttpClient, requestUri As Uri, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Parametri di tipo
- TValue
Tipo di destinazione in cui deserializzare.
Parametri
- client
- HttpClient
Client utilizzato per inviare la richiesta.
- requestUri
- Uri
URI a cui viene inviata la richiesta.
- jsonTypeInfo
- JsonTypeInfo<TValue>
JsonTypeInfo usato per controllare il comportamento di deserializzazione.
- cancellationToken
- CancellationToken
Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.
Valori restituiti
Oggetto attività che rappresenta l'operazione asincrona.
Eccezioni
Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.