HttpContentJsonExtensions.ReadFromJsonAsync Metod

Definition

Överlagringar

Name Description
ReadFromJsonAsync(HttpContent, Type, CancellationToken)

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken)

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken)

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

ReadFromJsonAsync<T>(HttpContent, CancellationToken)

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken)

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

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

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

ReadFromJsonAsync(HttpContent, Type, CancellationToken)

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

[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)

Parametrar

content
HttpContent

Innehållet som ska läsas från.

type
Type

Typen av objekt som ska deserialiseras till och returneras.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Attribut

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för

ReadFromJsonAsync(HttpContent, Type, JsonSerializerOptions, CancellationToken)

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

[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)

Parametrar

content
HttpContent

Innehållet som ska läsas från.

type
Type

Typen av objekt som ska deserialiseras till och returneras.

options
JsonSerializerOptions

Alternativ för att styra beteendet under deserialiseringen. Standardalternativen är de som anges av Web.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Attribut

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för

ReadFromJsonAsync(HttpContent, Type, JsonSerializerContext, CancellationToken)

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

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)

Parametrar

content
HttpContent

Innehållet som ska läsas från.

type
Type

Typen av objekt som ska deserialiseras till och returneras.

context
JsonSerializerContext

JsonSerializerContext som används för att styra deserialiseringsbeteendet.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för

ReadFromJsonAsync<T>(HttpContent, CancellationToken)

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

[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)

Typparametrar

T

Måltypen som deserialisera till.

Parametrar

content
HttpContent

Innehållet som ska läsas från.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Task<T>

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Attribut

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för

ReadFromJsonAsync<T>(HttpContent, JsonSerializerOptions, CancellationToken)

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

[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)

Typparametrar

T

Måltypen som deserialisera till.

Parametrar

content
HttpContent

Innehållet som ska läsas från.

options
JsonSerializerOptions

Alternativ för att styra beteendet under deserialiseringen. Standardalternativen är de som anges av Web.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Task<T>

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Attribut

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för

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

Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs
Källa:
HttpContentJsonExtensions.cs

Läser HTTP-innehållet och returnerar värdet som är resultatet av att deserialisera innehållet som JSON i en asynkron åtgärd.

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)

Typparametrar

T

Måltypen som deserialisera till.

Parametrar

content
HttpContent

Innehållet som ska läsas från.

jsonTypeInfo
JsonTypeInfo<T>

JsonTypeInfo som används för att styra deserialiseringsbeteendet.

cancellationToken
CancellationToken

En annulleringstoken som kan användas av andra objekt eller trådar för att få meddelande om annullering.

Returer

Task<T>

Aktivitetsobjektet som representerar den asynkrona åtgärden.

Undantag

Annulleringstoken avbröts. Det här undantaget lagras i den returnerade aktiviteten.

Gäller för