HttpContentJsonExtensions.ReadFromJsonAsync Methode
Definitie
Belangrijk
Bepaalde informatie heeft betrekking op een voorlopige productversie die aanzienlijk kan worden gewijzigd voordat deze wordt uitgebracht. Microsoft biedt geen enkele expliciete of impliciete garanties met betrekking tot de informatie die hier wordt verstrekt.
Overloads
| Name | Description |
|---|---|
| ReadFromJsonAsync(HttpContent, Type, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
| ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
| ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
| ReadFromJsonAsync<T>(HttpContent, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
| ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
| ReadFromJsonAsync<T>(HttpContent, JsonTypeInfo<T>, CancellationToken) |
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking. |
ReadFromJsonAsync(HttpContent, Type, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
[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)
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- type
- Type
Het type object waarnaar moet worden gedeserialiseerd en geretourneerd.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
- Kenmerken
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.
Van toepassing op
ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
[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)
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- type
- Type
Het type object waarnaar moet worden gedeserialiseerd en geretourneerd.
- options
- JsonSerializerOptions
Opties voor het beheren van het gedrag tijdens deserialisatie. De standaardopties zijn de opties die zijn opgegeven door Web.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
- Kenmerken
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.
Van toepassing op
ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
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)
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- type
- Type
Het type object waarnaar moet worden gedeserialiseerd en geretourneerd.
- context
- JsonSerializerContext
De JsonSerializerContext die wordt gebruikt om het deserialisatiegedrag te beheren.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.
Van toepassing op
ReadFromJsonAsync<T>(HttpContent, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
[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)
Type parameters
- T
Het doeltype dat moet worden gedeserialiseerd.
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
- Kenmerken
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.
Van toepassing op
ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
[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)
Type parameters
- T
Het doeltype dat moet worden gedeserialiseerd.
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- options
- JsonSerializerOptions
Opties voor het beheren van het gedrag tijdens deserialisatie. De standaardopties zijn de opties die zijn opgegeven door Web.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
- Kenmerken
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.
Van toepassing op
ReadFromJsonAsync<T>(HttpContent, JsonTypeInfo<T>, CancellationToken)
Leest de HTTP-inhoud en retourneert de waarde die het resultaat is van het deserialiseren van de inhoud als JSON in een asynchrone bewerking.
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)
Type parameters
- T
Het doeltype dat moet worden gedeserialiseerd.
Parameters
- content
- HttpContent
De inhoud waaruit moet worden gelezen.
- jsonTypeInfo
- JsonTypeInfo<T>
De JsonTypeInfo die wordt gebruikt om het deserialisatiegedrag te beheren.
- cancellationToken
- CancellationToken
Een annuleringstoken dat kan worden gebruikt door andere objecten of threads om kennisgeving van annulering te ontvangen.
Retouren
Het taakobject dat de asynchrone bewerking vertegenwoordigt.
Uitzonderingen
Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.