Table of Contents

Class JsonContent

Namespace
Kampute.HttpClient.NewtonsoftJson
Assembly
Kampute.HttpClient.NewtonsoftJson.dll

Represents HTTP content based on JSON serialized from an object.

public sealed class JsonContent : HttpContent, IDisposable
Inheritance
JsonContent
Implements
Inherited Members
Extension Methods

Constructors

JsonContent(object)

Initializes a new instance of the JsonContent class.

public JsonContent(object content)

Parameters

content object

The object to be serialized into JSON format.

Exceptions

ArgumentNullException

Thrown if content is null.

Properties

Settings

Gets or sets the JSON serialization settings.

public JsonSerializerSettings? Settings { get; set; }

Property Value

JsonSerializerSettings

The JSON serialization settings, if any.

Methods

SerializeToStreamAsync(Stream, TransportContext)

protected override Task SerializeToStreamAsync(Stream stream, TransportContext context)

Parameters

stream Stream
context TransportContext

Returns

Task

TryComputeLength(out long)

protected override bool TryComputeLength(out long length)

Parameters

length long

Returns

bool