Table of Contents

Class XmlContentDeserializer

Namespace
Kampute.HttpClient.Xml
Assembly
Kampute.HttpClient.Xml.dll

Provides functionality for deserializing XML content from HTTP responses into objects.

public sealed class XmlContentDeserializer : HttpContentDeserializer, IHttpContentDeserializer
Inheritance
XmlContentDeserializer
Implements
Inherited Members

Constructors

XmlContentDeserializer()

Initializes a new instance of the XmlContentDeserializer class.

public XmlContentDeserializer()

Methods

DeserializeAsync(HttpContent, Type, CancellationToken)

Asynchronously reads an object from the provided HttpContent.

public override Task<object?> DeserializeAsync(HttpContent content, Type modelType, CancellationToken cancellationToken = default)

Parameters

content HttpContent

The HttpContent to read from.

modelType Type

The type of the object to read.

cancellationToken CancellationToken

A token for canceling the read operation (optional).

Returns

Task<object>

A task representing the asynchronous read operation, containing the deserialized object.

Exceptions

ArgumentNullException

Thrown if content or modelType is null.