HttpClientJsonExtensions.GetFromJsonAsync Metode
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Overload
| Nama | Deskripsi |
|---|---|
| GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync(HttpClient, Uri, Type, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync(HttpClient, String, Type, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, String, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
| GetFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken) |
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron. |
GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerOptions, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- options
- JsonSerializerOptions
Opsi untuk mengontrol perilaku selama deserialisasi. Opsi default adalah yang ditentukan oleh Web.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync(HttpClient, String, Type, JsonSerializerContext, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- context
- JsonSerializerContext
JsonSerializerContext digunakan untuk mengontrol perilaku deserialisasi.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync(HttpClient, Uri, Type, JsonSerializerContext, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- context
- JsonSerializerContext
JsonSerializerContext digunakan untuk mengontrol perilaku deserialisasi.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync(HttpClient, Uri, Type, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Keterangan
Metode ini menggunakan JsonSerializerDefaults.Web opsi untuk deserialisasi, sedangkan JsonSerializer metode deserialisasi tidak, secara default.
Berlaku untuk
GetFromJsonAsync(HttpClient, String, Type, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Keterangan
Metode ini menggunakan JsonSerializerDefaults.Web opsi untuk deserialisasi, sedangkan JsonSerializer metode deserialisasi tidak, secara default.
Berlaku untuk
GetFromJsonAsync(HttpClient, String, Type, JsonSerializerOptions, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- type
- Type
Jenis objek yang akan dideserialisasi ke dan dikembalikan.
- options
- JsonSerializerOptions
Opsi untuk mengontrol perilaku selama deserialisasi. Opsi default adalah yang ditentukan oleh Web.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, String, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Keterangan
Metode ini menggunakan JsonSerializerDefaults.Web opsi untuk deserialisasi, sedangkan JsonSerializer metode deserialisasi tidak, secara default.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, Uri, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Keterangan
Metode ini menggunakan JsonSerializerDefaults.Web opsi untuk deserialisasi, sedangkan JsonSerializer metode deserialisasi tidak, secara default.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- options
- JsonSerializerOptions
Opsi untuk mengontrol perilaku selama deserialisasi. Opsi default adalah yang ditentukan oleh Web.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- String
Uri tempat permintaan dikirim.
- jsonTypeInfo
- JsonTypeInfo<TValue>
JsonTypeInfo digunakan untuk mengontrol perilaku deserialisasi.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
[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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- options
- JsonSerializerOptions
Opsi untuk mengontrol perilaku selama deserialisasi. Opsi default adalah yang ditentukan oleh Web.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
- Atribut
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.
Berlaku untuk
GetFromJsonAsync<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)
Mengirim permintaan GET ke Uri yang ditentukan dan mengembalikan nilai yang dihasilkan dari deserialisasi isi respons sebagai JSON dalam operasi asinkron.
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)
Jenis parameter
- TValue
Jenis target yang akan dideserialisasi.
Parameter
- client
- HttpClient
Klien digunakan untuk mengirim permintaan.
- requestUri
- Uri
Uri tempat permintaan dikirim.
- jsonTypeInfo
- JsonTypeInfo<TValue>
JsonTypeInfo digunakan untuk mengontrol perilaku deserialisasi.
- cancellationToken
- CancellationToken
Token pembatalan yang dapat digunakan oleh objek atau utas lain untuk menerima pemberitahuan pembatalan.
Mengembalikan
Objek tugas yang mewakili operasi asinkron.
Pengecualian
Token pembatalan dibatalkan. Pengecualian ini disimpan ke dalam tugas yang dikembalikan.