<PackageReference Include="Microsoft.AspNet.WebApi.Client" Version="6.0.0" />

HttpContentExtensions

public static class HttpContentExtensions
Specifies extension methods to allow strongly typed objects to be read from HttpContent instances.
public static Task<object> ReadAsAsync(this HttpContent content, Type type)

Returns a Task that will yield an object of the specified type from the content instance.

public static Task<object> ReadAsAsync(this HttpContent content, Type type, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content.

public static Task<object> ReadAsAsync(this HttpContent content, Type type, IEnumerable<MediaTypeFormatter> formatters)

Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content.

public static Task<object> ReadAsAsync(this HttpContent content, Type type, IEnumerable<MediaTypeFormatter> formatters, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content.

public static Task<object> ReadAsAsync(this HttpContent content, Type type, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger)

Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content.

public static Task<object> ReadAsAsync(this HttpContent content, Type type, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance using one of the provided formatters to deserialize the content.

public static Task<T> ReadAsAsync<T>(this HttpContent content)

Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.

public static Task<T> ReadAsAsync<T>(this HttpContent content, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance.

public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters)

Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.

public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance.

public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger)

Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.

public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)

Returns a Task that will yield an object of the specified type from the content instance.