HttpContentExtensions
Extension methods to allow strongly typed objects to be read from HttpContent instances.
public static Task<object> ReadAsAsync(this HttpContent content, Type type, CancellationToken cancellationToken)
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, IEnumerable<MediaTypeFormatter> formatters)
public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, CancellationToken cancellationToken)
public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger)
public static Task<T> ReadAsAsync<T>(this HttpContent content, IEnumerable<MediaTypeFormatter> formatters, IFormatterLogger formatterLogger, CancellationToken cancellationToken)