Development · Native API migration preview · Coverage validation in progress Published release →

API Browser

Method

Read

static func Read(content: HttpContent) -> Task<Result<string, HttpError>>

Declaring type: HttpStringContent
Module: System.Web.Http
Assembly: System.Web.dll
Source file: HttpContentTypes.rvn

Reads a buffered or streaming body as strict UTF-8 text.

Parameters

Name Type Description
content HttpContent Content to read; a streaming body is consumed once, without closing it.

Return value

Task<Result<String, HttpError>>

Owned text, a content I/O error, or Protocol for invalid UTF-8. Streaming text materialization currently has a 65536-byte limit.

Remarks

No Content-Type negotiation or decompression. Streaming reads use the incremental UTF-8 decoder with bounded byte staging. Memory content is decoded directly from its selected window.