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

API Browser

Member group

Read

Declaring type: JsonContent
Module: System.Web.Http.Json
Assembly: System.Web.dll
Source file: JsonContent.rvn

Overloads / Variants

Read

static func Read(content: HttpContent, type: TypeInfo) -> Result<object, JsonError>

Source file: JsonContent.rvn

Reads a model from buffered HTTP content using a runtime-backed type.

Parameters

Name Type Description
content HttpContent Buffered request or response bytes.
type TypeInfo Supported scalar, typed array, or public nongeneric reference class with a public parameterless constructor.

Return value

Result<Object, JsonError>

The model or unchanged JSON/reflection error.

Remarks

Same mapping rules as JsonSerializer.Deserialize. Headers, status and lifecycle remain caller policy; reads do not consume content.

Read

static func Read<T>(content: HttpContent) -> Result<T, JsonError>

Source file: JsonContent.rvn

Reads a typed model from buffered HTTP content.

Type parameters

Name Description
T Supported scalar, typed array, or public nongeneric reference class with a public parameterless constructor.

Parameters

Name Type Description
content HttpContent Buffered request or response bytes, retained after reading.

Return value

Result<T, JsonError>

The model or unchanged JsonError, including UnsupportedMapping for unsupported T shapes.

Remarks

Synchronous; same UTF-8, limits, mapping and lifecycle policy as the TypeInfo overload.