Table of Contents

Class HttpContentExtensions

Namespace
TypedRest.Http
Assembly
TypedRest.dll

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 HttpContent

The HTTP content from which to read.

serializers IReadOnlyList<MediaTypeFormatter>

A list of serializers available for deserializing the body.

cancellationToken CancellationToken

Used to cancel the request.

Returns

Task<T>

Type Parameters

T

The type of the object to read.