Partager via


HttpContentExtensions Class

Specifies extension methods to allow strongly typed objects to be read from HttpContent instances.

Inheritance Hierarchy

System.Object
  System.Net.Http.HttpContentExtensions

Namespace:  System.Net.Http
Assembly:  System.Net.Http.Formatting (in System.Net.Http.Formatting.dll)

Syntax

'Declaration
<ExtensionAttribute> _
Public NotInheritable Class HttpContentExtensions
'Usage
public static class HttpContentExtensions
[ExtensionAttribute]
public ref class HttpContentExtensions abstract sealed
[<AbstractClassAttribute>]
[<SealedAttribute>]
type HttpContentExtensions =  class end
public final class HttpContentExtensions

Methods

  Name Description
Public methodStatic member ReadAsAsync(HttpContent, Type) Returns a Task that will yield an object of the specified type from the content instance.
Public methodStatic member ReadAsAsync(HttpContent, Type, IEnumerable<MediaTypeFormatter>) 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 methodStatic member ReadAsAsync(HttpContent, Type, IEnumerable<MediaTypeFormatter>, IFormatterLogger) 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 methodStatic member ReadAsAsync<T>(HttpContent) Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.
Public methodStatic member ReadAsAsync<T>(HttpContent, IEnumerable<MediaTypeFormatter>) Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.
Public methodStatic member ReadAsAsync<T>(HttpContent, IEnumerable<MediaTypeFormatter>, IFormatterLogger) Returns a Task that will yield an object of the specified type <typeparamref name="T" /> from the content instance.

Top

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

See Also

Reference

System.Net.Http Namespace