Class HttpContentExtensions
Provides extension methods for HttpContent.
public static class HttpContentExtensions
- Inheritance
-
HttpContentExtensions
- Inherited Members
Methods
ReadAsAsync<T>(HttpContent, IReadOnlyList<MediaTypeFormatter>, CancellationToken)
Deserializes HTTP content as an object.
public static Task<T> ReadAsAsync<T>(this HttpContent content, IReadOnlyList<MediaTypeFormatter> serializers, CancellationToken cancellationToken = default)
Parameters
content
HttpContentThe HTTP content from which to read.
serializers
IReadOnlyList<MediaTypeFormatter>A list of serializers available for deserializing the body.
cancellationToken
CancellationTokenUsed to cancel the request.
Returns
- Task<T>
Type Parameters
T
The type of the object to read.