Skip to content

NewtonsoftJsonContentSerializer.DeserializeFromString(string) method

Defined in

Type: NewtonsoftJsonContentSerializer Namespace: Refit Assembly: Refit.Newtonsoft.Json.dll

Applies to

net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481, net471

Attributes: [UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with RequiresUnreferencedCodeAttribute may break when trimming", Justification = "Interface method is unannotated on net8.0+ so cannot propagate; Newtonsoft path is documented as unsuitable for trimmed/AOT apps.")] [UnconditionalSuppressMessage("AOT", "IL3050:Calling members annotated with RequiresDynamicCodeAttribute may break when AOT compiling", Justification = "Interface method is unannotated on net8.0+ so cannot propagate; Newtonsoft path is documented as unsuitable for trimmed/AOT apps.")]

public T? DeserializeFromString<T>(string content)

View source

Inherited documentation

These docs were inherited from ISynchronousContentDeserializer. The member doesn't override them on this type.

Summary: Deserializes content synchronously into an object of type T.

Type parameters

NameDescription
TThe type to deserialize the content to.

Parameters

NameTypeDescription
contentstringThe already-buffered content string.

Returns: T? -- The deserialized object of type T.