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
HttpContentThe HttpContent to read from.
modelType
TypeThe type of the object to read.
cancellationToken
CancellationTokenA 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
ormodelType
is null.