HttpClientJsonExtensions.GetFromJsonAsAsyncEnumerable Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Sobrecargas
| Name | Description |
|---|---|
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, CancellationToken) |
Envia um |
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, CancellationToken) |
Envia um |
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken) |
Envia um |
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken) |
Envia um |
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken) |
Envia um |
| GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken) |
Envia um |
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, CancellationToken)
Envia um HTTP GETpedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
[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.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<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 GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * string * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * string * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As String, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- String
O Uri para onde o pedido é enviado.
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
- Atributos
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.
Aplica-se a
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, CancellationToken)
Envia um HTTP GETpedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
[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.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<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 GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * Uri * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * Uri * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As Uri, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- Uri
O Uri para onde o pedido é enviado.
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
- Atributos
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.
Aplica-se a
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)
Envia um HTTP GET pedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
[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.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<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 GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * string * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * string * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As String, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- String
O Uri para onde o pedido é enviado.
- options
- JsonSerializerOptions
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
- Atributos
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.
Aplica-se a
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)
Envia um HTTP GETpedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, string? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * string * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As String, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- String
O Uri para onde o pedido é enviado.
- jsonTypeInfo
- JsonTypeInfo<TValue>
O JsonTypeInfo era usado para controlar o comportamento durante a desserialização.
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.
Aplica-se a
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)
Envia um HTTP GETpedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
[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.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.JsonSerializerOptions? options, System.Threading.CancellationToken cancellationToken = default);
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<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 GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * Uri * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * Uri * System.Text.Json.JsonSerializerOptions * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As Uri, options As JsonSerializerOptions, Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- Uri
O Uri para onde o pedido é enviado.
- options
- JsonSerializerOptions
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
- Atributos
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.
Aplica-se a
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)
Envia um HTTP GETpedido para o especificado requestUri e devolve o valor resultante da desserialização do corpo da resposta como JSON numa operação enumerável assíncrona.
public static System.Collections.Generic.IAsyncEnumerable<TValue?> GetFromJsonAsAsyncEnumerable<TValue>(this System.Net.Http.HttpClient client, Uri? requestUri, System.Text.Json.Serialization.Metadata.JsonTypeInfo<TValue> jsonTypeInfo, System.Threading.CancellationToken cancellationToken = default);
static member GetFromJsonAsAsyncEnumerable : System.Net.Http.HttpClient * Uri * System.Text.Json.Serialization.Metadata.JsonTypeInfo<'Value> * System.Threading.CancellationToken -> System.Collections.Generic.IAsyncEnumerable<'Value>
<Extension()>
Public Function GetFromJsonAsAsyncEnumerable(Of TValue) (client As HttpClient, requestUri As Uri, jsonTypeInfo As JsonTypeInfo(Of TValue), Optional cancellationToken As CancellationToken = Nothing) As IAsyncEnumerable(Of TValue)
Parâmetros de Tipo Genérico
- TValue
O tipo de alvo para desserializar.
Parâmetros
- client
- HttpClient
O cliente costumava enviar o pedido.
- requestUri
- Uri
O Uri para onde o pedido é enviado.
- jsonTypeInfo
- JsonTypeInfo<TValue>
O JsonTypeInfo era usado para controlar o comportamento durante a desserialização.
- cancellationToken
- CancellationToken
Um token de cancelamento que pode ser usado por outros objetos ou threads para receber aviso de cancelamento.
Devoluções
Um IAsyncEnumerable<T> que representa o corpo de resposta desserializado.
Exceções
O client é null.
O token de cancelamento foi cancelado. Esta exceção é armazenada na tarefa devolvida.