Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

HttpClientJsonExtensions.GetFromJsonAsAsyncEnumerable Method

Definition

Namespace:
System.Net.Http.Json
Assembly:
System.Net.Http.Json.dll
Package:
System.Net.Http.Json v11.0.0-preview.5.26302.115

Important

Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.

Overloads

Name Description
GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, CancellationToken)

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, CancellationToken)

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)

Sends an HTTP GET request to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Attributes

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Attributes

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GET request to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Attributes

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, String, JsonTypeInfo<TValue>, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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)

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
String

The Uri the request is sent to.

jsonTypeInfo
JsonTypeInfo<TValue>

The JsonTypeInfo used to control the behavior during deserialization.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonSerializerOptions, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Attributes

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to

GetFromJsonAsAsyncEnumerable<TValue>(HttpClient, Uri, JsonTypeInfo<TValue>, CancellationToken)

Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs
Source:
HttpClientJsonExtensions.Get.AsyncEnumerable.cs

Sends an HTTP GETrequest to the specified requestUri and returns the value that results from deserializing the response body as JSON in an async enumerable operation.

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)

Type Parameters

TValue

The target type to deserialize to.

Parameters

client
HttpClient

The client used to send the request.

requestUri
Uri

The Uri the request is sent to.

jsonTypeInfo
JsonTypeInfo<TValue>

The JsonTypeInfo used to control the behavior during deserialization.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

An IAsyncEnumerable<T> that represents the deserialized response body.

Exceptions

The client is null.

The cancellation token was canceled. This exception is stored into the returned task.

Applies to


Feedback

Was this page helpful?