XmlContentDeserializer Class

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

Definition

Provides functionality for deserializing XML content from HTTP responses into objects.
public sealed class XmlContentDeserializer : HttpContentDeserializer
Inheritance

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 optional
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.