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
- object
- HttpContentDeserializer
- XmlContentDeserializer
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
contentHttpContent- The HttpContent to read from.
modelTypeType- The type of the object to read.
cancellationTokenCancellationToken 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
contentormodelTypeisnull.
