HttpContentJsonExtensions.ReadFromJsonAsync Metodo

Definizione

Overload

Nome Descrizione
ReadFromJsonAsync(HttpContent, Type, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync<T>(HttpContent, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync<T>(HttpContent, JsonTypeInfo<T>, CancellationToken)

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

ReadFromJsonAsync(HttpContent, Type, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto 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?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, 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 ReadFromJsonAsync : System.Net.Http.HttpContent * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member ReadFromJsonAsync : System.Net.Http.HttpContent * Type * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function ReadFromJsonAsync (content As HttpContent, type As Type, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

Parametri

content
HttpContent

Contenuto da cui leggere.

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.

Si applica a

ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto 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?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Text.Json.JsonSerializerOptions? options = default, 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?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Text.Json.JsonSerializerOptions? options = default, 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.")]
public static System.Threading.Tasks.Task<object?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<object?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, 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 ReadFromJsonAsync : System.Net.Http.HttpContent * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
static member ReadFromJsonAsync : System.Net.Http.HttpContent * 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 ReadFromJsonAsync : System.Net.Http.HttpContent * Type * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function ReadFromJsonAsync (content As HttpContent, type As Type, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)
<Extension()>
Public Function ReadFromJsonAsync (content As HttpContent, type As Type, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

Parametri

content
HttpContent

Contenuto da cui leggere.

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

ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

public static System.Threading.Tasks.Task<object?> ReadFromJsonAsync(this System.Net.Http.HttpContent content, Type type, System.Text.Json.Serialization.JsonSerializerContext context, System.Threading.CancellationToken cancellationToken = default);
static member ReadFromJsonAsync : System.Net.Http.HttpContent * Type * System.Text.Json.Serialization.JsonSerializerContext * System.Threading.CancellationToken -> System.Threading.Tasks.Task<obj>
<Extension()>
Public Function ReadFromJsonAsync (content As HttpContent, type As Type, context As JsonSerializerContext, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Object)

Parametri

content
HttpContent

Contenuto da cui leggere.

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

ReadFromJsonAsync<T>(HttpContent, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto 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<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, 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 ReadFromJsonAsync : System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
static member ReadFromJsonAsync : System.Net.Http.HttpContent * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ReadFromJsonAsync(Of T) (content As HttpContent, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

Parametri di tipo

T

Tipo di destinazione in cui deserializzare.

Parametri

content
HttpContent

Contenuto da cui leggere.

cancellationToken
CancellationToken

Token di annullamento che può essere utilizzato da altri oggetti o thread per ricevere un avviso di annullamento.

Valori restituiti

Task<T>

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

ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto 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<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options = default, 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<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options = default, 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.")]
public static System.Threading.Tasks.Task<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Text.Json.JsonSerializerOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
public static System.Threading.Tasks.Task<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, 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 ReadFromJsonAsync : System.Net.Http.HttpContent * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
static member ReadFromJsonAsync : System.Net.Http.HttpContent * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
[<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 ReadFromJsonAsync : System.Net.Http.HttpContent * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ReadFromJsonAsync(Of T) (content As HttpContent, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)
<Extension()>
Public Function ReadFromJsonAsync(Of T) (content As HttpContent, Optional options As JsonSerializerOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

Parametri di tipo

T

Tipo di destinazione in cui deserializzare.

Parametri

content
HttpContent

Contenuto da cui leggere.

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

Task<T>

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

ReadFromJsonAsync<T>(HttpContent, JsonTypeInfo<T>, CancellationToken)

Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs
Origine:
HttpContentJsonExtensions.cs

Legge il contenuto HTTP e restituisce il valore risultante dalla deserializzazione del contenuto come JSON in un'operazione asincrona.

public static System.Threading.Tasks.Task<T?> ReadFromJsonAsync<T>(this System.Net.Http.HttpContent content, System.Text.Json.Serialization.Metadata.JsonTypeInfo<T> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member ReadFromJsonAsync : System.Net.Http.HttpContent * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'T> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
<Extension()>
Public Function ReadFromJsonAsync(Of T) (content As HttpContent, jsonTypeInfo As JsonTypeInfo(Of T), Optional cancellationToken As CancellationToken = Nothing) As Task(Of T)

Parametri di tipo

T

Tipo di destinazione in cui deserializzare.

Parametri

content
HttpContent

Contenuto da cui leggere.

jsonTypeInfo
JsonTypeInfo<T>

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

Task<T>

Oggetto attività che rappresenta l'operazione asincrona.

Eccezioni

Il token di annullamento è stato annullato. Questa eccezione viene archiviata nell'attività restituita.

Si applica a