JsonNode.ParseAsync Method
Definition
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.
public static System.Threading.Tasks.Task<System.Text.Json.Nodes.JsonNode?> ParseAsync (System.IO.Stream utf8Json, System.Text.Json.Nodes.JsonNodeOptions? nodeOptions = default, System.Text.Json.JsonDocumentOptions documentOptions = default, System.Threading.CancellationToken cancellationToken = default);
static member ParseAsync : System.IO.Stream * Nullable<System.Text.Json.Nodes.JsonNodeOptions> * System.Text.Json.JsonDocumentOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Text.Json.Nodes.JsonNode>
Public Shared Function ParseAsync (utf8Json As Stream, Optional nodeOptions As Nullable(Of JsonNodeOptions) = Nothing, Optional documentOptions As JsonDocumentOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of JsonNode)
Parameters
- utf8Json
- Stream
The JSON text to parse.
- nodeOptions
- Nullable<JsonNodeOptions>
Options to control the node behavior after parsing.
- documentOptions
- JsonDocumentOptions
Options to control the document behavior during parsing.
- cancellationToken
- CancellationToken
The token to monitor for cancellation requests.
Returns
A Task to produce either a JsonNode representation of the JSON value, or null if the input represents the null JSON value.
Exceptions
utf8Json
does not represent a valid single JSON value.
The cancellation token was canceled. This exception is stored into the returned task.