JsonDocument.ParseAsync(Stream, JsonDocumentOptions, CancellationToken) 方法
定义
public static System.Threading.Tasks.Task<System.Text.Json.JsonDocument> ParseAsync (System.IO.Stream utf8Json, System.Text.Json.JsonDocumentOptions options = default, System.Threading.CancellationToken cancellationToken = default);
static member ParseAsync : System.IO.Stream * System.Text.Json.JsonDocumentOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Text.Json.JsonDocument>
Public Shared Function ParseAsync (utf8Json As Stream, Optional options As JsonDocumentOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of JsonDocument)
参数
- utf8Json
- Stream
要分析的 JSON 数据。The JSON data to parse.
- options
- JsonDocumentOptions
分析期间用于控制读取器行为的选项。Options to control the reader behavior during parsing.
- cancellationToken
- CancellationToken
要监视取消请求的标记。The token to monitor for cancellation requests.
返回
用于生成 JSON 值的 JsonDocument 表示的任务。A task to produce a JsonDocument representation of the JSON value.
例外
utf8Json 不表示有效的单个 JSON 值。utf8Json does not represent a valid single JSON value.
options 包含不受支持的选项。options contains unsupported options.